fpc/tests/webtbs/tw8180.pp
Jonas Maebe cc315e0ac7 * fix tw3930 after r37927
o "unique" class (and interface) type aliases should actually not exist at
     all except for overload resolution. All the rest (VMT, UUID, RTTI, ...)
     should be taken from the aliased class/interface
   o there is one Delphi-incompatibily left after this change, but it shouldn't
     matter: tw8180 does not compile if you change the declaration to
     "tcl=class(TInterfacedObject,XStr,iinterface)", while Kylix does compile
     that. It doesn't really matter though, because in Kylix this actually
     adds iinterface twice as implemented interface, so there is no point
     in accepting this.

git-svn-id: trunk@46773 -
2020-09-05 12:25:09 +00:00

24 lines
346 B
ObjectPascal

{ %recompile }
{$mode objfpc}
uses uw8180;
type
tcl=class(TInterfacedObject,XStr)
end;
var
x : tcl;
p: pointer;
i: iunknown;
begin
x:=tcl.create;
x._Addref;
i:=x as iunknown;
if (x as iunknown).queryinterface(xstr,p) <> S_OK then
halt(1);
if (x as iunknown).queryinterface(iinterface,p) <> S_OK then
halt(2);
end.