[PATCH] Using a forward declared subtype is incompatible with a typed generic declaration.
<h3><details><summary>Original Reporter info from Mantis: <small>AndrewH @andrewd207</small></summary><small>
- **Reporter name:**
</small></details></h3>
## Description:
TA = class; // forward<br/>
TB = class; // forward TB = class(TA)
TBaseAList&LtPos;T: TA> = class // no problems using forward declared TA<br/>
end;
TAList = class(TBaseAList&LtPos;TA>); // no problem<br/>
TBList = class(TBaseAList&LtPos;TB>); // message: expected TA got TB!
TA = class<br/>
end;
TB = class(TA)<br/>
end;
The attached patch makes this work. I'm not sure how Delphi behaves as I don't have it.
## Steps to reproduce:
``` pascal
program Project1;
{$IFDEF FPC}
{$mode delphi}{$H+}
{$ENDIF}
type
TA = class; // forward
TB = class; // forward TB = class(TA)
//TC = class; // forward
TBaseAList<T: TA> = class // no problems
Foo: T;
end;
TAList = class(TBaseAList<TA>); // no problem
TBList = class(TBaseAList<TB>); // message: expected TA got TB!
//TCList = class(TBaseAList<TC>); // indicates that TC should inherit from TA
TA = class
end;
TB = class(TA)
end;
//TC = class(TObject); // not related to TA and should always fail.
begin
end.
```
## Mantis conversion info:
- **Mantis ID:** 37953
- **Version:** 3.3.1
- **Monitored by:** » @sergy.larin (Sergey Larin)
issue