[Gambas-user] Big incompatible change

Fabián Flores Vadell fabianfloresvadell at ...626...
Sun Aug 21 02:42:07 CEST 2011


2011/8/20 Benoît Minisini <gambas at ...1...>:
>> 2011/8/19 Benoît Minisini <gambas at ...1...>:
>> > To fix the bug tracker issue #78, I had to do some incompatible changes.
>> >
>> > But now, changing the return datatype of a method through inheritance is
>> > now correctly forbidden.
>> >
>> > Theoretically, I have to prevent method signature from changing between
>> > inheritance too. But it is more complex to do that, so it will come
>> > later.
>> >
>> > I hope that it won't break your projects too much.
>>
>> So, the signature and the return value of a method in a sub-class
>> should be identical to the method in its super-class.
>>
>> If some of them is different in the sub-class, then the method on the
>> sub-class is a new one, not the redefinition of the method on the
>> super-class, ¿right?
>
> No, because a method is only identified by its name, not by its signature.
>

I'm tired and I have flu, maybe that make me feel so confusing about that.

So, I can't have a method in the subclass with the same name but
different signature or return value, of that method in the superclass
(because in fact that is what Gambas will prevent).

If I do that Gambas will raise an error.

Right?

-- 
Fabián Flores Vadell
www.comoprogramarcongambas.blogspot.com
www.speedbooksargentina.blogspot.com




More information about the User mailing list