Generic array of generic type fails with internal error when it contains a specialized function.
Original Reporter info from Mantis: michael @mvancanneyt
-
Reporter name: Michael Van Canneyt
Original Reporter info from Mantis: michael @mvancanneyt
- Reporter name: Michael Van Canneyt
Description:
The following fails to compile:
{$mode objfpc}
type
generic TDistanceFunction<t> = function (x,y : t) : Extended;
generic PlanarCoordinate<t> = record
x,y : t;
d : specialize TDistanceFunction<t>;
end;
TScreenCoordinate = specialize PLanarCoordinate<word>;
TDiscreteCoordinate = specialize PlanarCoordinate<integer>;
TRealCoordinate = specialize PlanarCoordinate<extended>;
TScreenDistance = specialize TDistanceFunction<word>;
TDiscreteDistance = specialize TDistanceFunction<integer>;
TRealDistance = specialize TDistanceFunction<Extended>;
generic TPointSet<t> = array of specialize PlanarCoordinate<t>;
begin
end.
Error:
gcb.pp(4,63) Fatal: Internal error 2014050901
Additional information:
From email exchange:
Does this also happen if you enable advanced records and declare the
"specialize TDistanceFunction&LtPos;T>" as a named type in the
"PlanarCoordinate&LtPos;T>" record?
Yes.
Does it also happen if you specialize
"PlanarCoordinate&LtPos;T>" separately (not inside the array, but with a specific
type)?
No, then it compiles.
Mantis conversion info:
- Mantis ID: 28530
- Platform: All
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 31437 (#66781b55)