[fpc-pascal] Supports() only checks declared interfaces?

Paul Ishenin webpirat at mail.ru
Thu Jan 6 14:59:30 CET 2011


06.01.2011 20:14, Michalis Kamburelis wrote:
> return true. After all, TB is forced to implement methods of both IA and
> IB, as IB descends from IA. But to my surprise, Supports(TB, IA) returns
> false.
>
> Changing the declaration to
>
>    TB = class(TInterfacedObject, IA, IB) end;
>
> workarounds the problem (Supports(TB, IA) returns true), but seems
> strange in my opinion.
>
> I haven't found any explanation for this e.g. in docs
> (http://freepascal.org/docs-html/rtl/sysutils/supports.html ,
> http://freepascal.org/docs-html/ref/refch7.html ).
>
> Is this the expected behavior? Documented anywhere? Or is this a bug,
> and I should submit it?
This is expected behavior. It works the same way as in delphi.

Best regards,
Paul Ishenin



More information about the fpc-pascal mailing list