> On Wed, 2011-08-31 at 03:13 +0200, Benoît Minisini wrote:
> > > Sorry, I'm really panicky, I meant method overriding not polymorphism.
> > > Bruce
> > 
> > This change only makes the interpreter raise an error instead of
> > eventually segfaulting, by preventing something that is forbidden :
> > changing the signature of a method through inheritance.
> > 
> > That has nothing to do with virtual dispatching : the overridden method
> > is always called.
> 
> Oh no!  I have dozens of gambas2 libraries that take advantage of this.
> See attached project for a "model" of lots of what I have done.  I don't
> understand why it should be "forbidden"?  Why would the interpreter
> segfault?
> Bruce

This is one the design rule of Gambas : a method has to always return the same 
datatype, otherwise it must return a Variant.

That way, the interpreter can optimize its code at runtime.

In your example, through inheritance, the same method may return a Variant[] 
or a String[] for example.

If you have a real example, I may tell you how to do differently.

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to