Michalis Kamburelis wrote:
> All you want is just to cover in class B identifier "Field" of class A.
> So you should make "Field" a dummy function in class A (that just
> returns a field value), and then you can redefine function name in
> descendant classes. See the example below. Within the scope of class B
> the "Field" function will return class G.

This is a smart hack, at best. It's abuse of function syntax IMHO (as if
they were fields). Second, you cannot assign to a function.

If the functions were inline, it could be as optimal, I agree; then you
have essentially localized the typecast to one place.

I just want to tell the compiler what I can guarantee, but what it
cannot automatically infer.

Thank you for the suggestion,

Micha
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to