[Gambas-user] Issue 78 in gambas: Illegal optimization / May a method's return value type in a derived class be different from the base class?

gambas at ...2524... gambas at ...2524...
Sat Sep 3 20:49:38 CEST 2011


Comment #6 on issue 78 by emil.len... at ...626...: Illegal optimization / May  
a method's return value type in a derived class be different from the base  
class?
http://code.google.com/p/gambas/issues/detail?id=78

Assume Class2 inherits Class1.
Is this OK:?

In Class1:
Public func(a As Integer) As Integer
End

In Class2:
Private func(a As Float) As Float
End

When running func() on either a Class1, or a Class2, only the method in  
Class1 will be invoked, because it is public and the other is private.

Or, easier said: Are private symbols affected by inheritance rules at all?





More information about the User mailing list