Generic class can't derive from parameterised type
Original Reporter info from Mantis: Hixie
-
Reporter name: Ian Hickson
Original Reporter info from Mantis: Hixie
- Reporter name: Ian Hickson
Description:
The type definition "generic TBar &LtPos;Parent> = class(Parent) end;" fails to compile with the error "class type expected, but got "&LtPos;undefined type>"".
Steps to reproduce:
{$MODE OBJFPC}
program tests;
type
TFoo = class
procedure Test();
end;
generic TBar <Parent> = class(Parent) end;
TBarOfFoo = specialize TBar <TFoo>;
procedure TFoo.Test(); begin end;
var
BarOfFoo: TBarOfFoo;
begin
BarOfFoo := TBarOfFoo.Create();
BarOfFoo.Test();
BarOfFoo.Free();
end.
Additional information:
Compilable test case at: http://junkyard.damowmow.com/469
Mantis conversion info:
- Mantis ID: 19549
- Build: trunk compiled 2011-06-05
- Version: 2.5.1