Multi-level generic inheritance causes Duplicate Identifier error
Original Reporter info from Mantis: Martok @martok
-
Reporter name:
Original Reporter info from Mantis: Martok @martok
- Reporter name:
Description:
Multiple level generic inheritance with inline specialization causes Duplicate Idenfier errors for the inline specialization if two hierarchies leading to the same generic base class are used.
In the attached example, the declaration of TIntDerived creates one instance of the generic IBase&LtPos;T> and the inline specialization in TBase.Test creates a second instance (which is identical, as it is made from the same type T). Note that the problem here is not that they may be assignment incompatible later on, but that the specialization itself fails.
Steps to reproduce:
See attached example, this yields:
generics_inheritance.pas(6,6) Error: Duplicate identifier "IBase1
crc6BDC5792"
generics_inheritance.pas(6,6) Hint: Identifier already defined in unit GENERICS_INHERITANCE: generics_inheritance.pas at line 8
The same hieararchy works when using {$mode delphi} and Delphi generic syntax.