[fpc-pascal] question with interfaces, hooks
Sven Barth
pascaldragon at googlemail.com
Wed Jul 15 11:21:41 CEST 2015
Am 15.07.2015 09:27 schrieb "Graeme Geldenhuys" <
mailinglists at geldenhuys.co.uk>:
>
> On 2015-07-15 05:06, David Emerson wrote:
> > So... since t_fancy_class implements the interface i_foo, why is
> > t_fancy_class.foo not available?
>
> Because you told it a property named "hook" implements it, so you need
> to call it as follows:
>
> fc.hook.foo;
"implements" should avoid the need for this. It merely tells the compiler
to look for methods using that property. The property could even be
protected or private and it should still work as long as the containing
class has the interface in its parent list.
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20150715/0aabe936/attachment.html>
More information about the fpc-pascal
mailing list