On 10/27/2016 06:01 AM, Tony Whyman wrote:

That is you can build an object hierarchy to parallel an interface
hierarchy.

I don't use the "Supports" primitive. - so maybe there is a bug in this
feature but otherwise, what is the problem with interface inheritance?

Yes, the problem is with "Supports" and "QueryInterface".
All of the examples you gave work fine (I didn't test them but they look like tests I've done)

The situation where "Supports" is needed looks more like this:

function do_something (t : tobject);
begin
  if supports (t, i_my_interface) then ....


So the situation is that we were passed an object, and we don't know what it is; but if we learn that it supports a particular interface, then we want to do something with that interface.

~David.



_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to