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

Michalis Kamburelis michalis.kambi at gmail.com
Thu Jan 6 17:25:36 CET 2011


Paul Ishenin wrote:
> 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.

> This is expected behavior. It works the same way as in delphi.
> 

Thank you.

So, the natural next question: is there some construct similar to the
Supports() function, that avoids this problem? That is, something that
detects that class TB supports both IA and IB interfaces, even though
it's declared only as "TB = class(TInterfacedObject, IB)" ?

Or is my only choice to just declare "TB = class(TInterfacedObject, IA,
IB)" ?

Michalis



More information about the fpc-pascal mailing list