P
PJ6
I'd like to be able to declare a function where it always returns the type
of the inheritor. To show this in as simple an example that I can think of,
where MyClassType is a reflexive generic type -
Public Class BaseClass
Public Function TestFunction() as MyClassType
Return Me
End Function
End Class
Public Class InheritedClass
Inherits BaseClass
End Class
I would like the the compiler to interpret the return type of
InheritedClass.TestFunction as InheritedClass, so I would never have to cast
from the base class, or write a type-specific function for each inheritor.
I admit this is a bit obscure and not exactly necessary - but I was just
wondering, is this in the works?
Paul
of the inheritor. To show this in as simple an example that I can think of,
where MyClassType is a reflexive generic type -
Public Class BaseClass
Public Function TestFunction() as MyClassType
Return Me
End Function
End Class
Public Class InheritedClass
Inherits BaseClass
End Class
I would like the the compiler to interpret the return type of
InheritedClass.TestFunction as InheritedClass, so I would never have to cast
from the base class, or write a type-specific function for each inheritor.
I admit this is a bit obscure and not exactly necessary - but I was just
wondering, is this in the works?
Paul