Hello,

Test env: debian jessie amd64 - fpc 3.0.2

It seems free pascal have a bug when handling interface inheritance using
generics.

When i try to compile the unit bellow, i get this error:

"interface_bug.pas(41,44) Error: Incompatible types: got
"TImplementor<System.LongInt>" expected "IParentInterface<System.LongInt>""


=== CODE ===

*unit* interface_bug;

{$mode delphi}

*interface*

*type*

  IParentInterface<T> = *interface*
    ['{0F78D56E-85A6-4024-98D7-720D7C7B9573}']
    *procedure* Foo;
  *end*;

  IChildInterface<T> = *interface*(IParentInterface<T>)
    ['{1AB2EB85-6843-462E-8CE4-32ECC065011E}']
    *procedure* Bar;
  *end*;

  TImplementor<T> =  class(TInterfacedObject, IChildInterface<T>)
  *public*
    *procedure* Foo;
    *procedure* Bar;
  *end*;

*var*
  ParentImplementorInstance: IParentInterface<Integer>;

*implementation*

*procedure* TImplementor<T>.Foo;
*begin*

*end*;

*procedure* TImplementor<T>.Bar;
*begin*

*end*;

*initialization*
  ParentImplementorInstance:=TImplementor<Integer>.Create;

*end*.


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

Reply via email to