Generic interface implementation
Original Reporter info from Mantis: alexvins
-
Reporter name: Alexander Shishkin
Original Reporter info from Mantis: alexvins
- Reporter name: Alexander Shishkin
Description:
In some cases variable of generic interface type become incompatible with implementation.
generictest9.lpr(10,16) Error: Incompatible types: got "TGenImpl1
LongInt" expected "ITest1
LongInt"
Steps to reproduce:
program generictest9;
{$mode delphi}
uses t9u1;
var
x: IIntTest;
begin
x := TGenImpl<Integer>.Create;
end.
unit t9u1;
{$mode delphi}
interface
type
ITest<T> = interface
end;
TGenImpl<T> = class (TInterfacedObject,ITest<T>)
end;
IIntTest = Itest<Integer>;
implementation
end.
Additional information:
if all code is in lpr file - no error
if "x: IIntTest;" changed to "x: Itest&LtPos;Integer>;" - no error
Mantis conversion info:
- Mantis ID: 21015
- Version: 2.7.1
- Fixed in version: 3.0.0
- Fixed in revision: 25609 (#bb00c76f)
- Monitored by: » taazz (John Kozikopoulos)