mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-24 09:19:13 +02:00
25 lines
506 B
ObjectPascal
25 lines
506 B
ObjectPascal
{ %FAIL }
|
|
|
|
{$mode objfpc}
|
|
unit tw23702;
|
|
{ Unit to demonstrate that free pascal does not complain
|
|
when generic types promise to implement an interface but
|
|
then do not. }
|
|
interface
|
|
|
|
type
|
|
IFoo = interface
|
|
function foo : byte;
|
|
end;
|
|
|
|
generic GBar<t> = class( TInterfacedObject, IFoo )
|
|
// does not implement foo, but compiler doesn't care.
|
|
end;
|
|
|
|
{TBar = class( TInterfacedObject, IFoo )
|
|
// does not implement foo, and compiler complains
|
|
end;}
|
|
|
|
implementation
|
|
end.
|