Add support to use generic type parameter in contant expression
Original Reporter info from Mantis: alexvins
-
Reporter name: Alexander Shishkin
Original Reporter info from Mantis: alexvins
- Reporter name: Alexander Shishkin
Description:
It`s impossible now to use (class) constants from generic parameter in constant expression. Is it possible to check constant expression in generic during specialization?
Steps to reproduce:
program project1;
{mode objfpc}{
H+}
{$R *.res}
type
TConstHolder = class
public
const
C = 10;
end;
TSimple = class
Arr: array [0..TConstHolder.C] of Integer; //this works
end;
generic TGeneric <T> = class
Arr: array [0..T.C] of Integer; //but here is error
// Can't evaluate constant expression
end;
begin
end.
Mantis conversion info:
- Mantis ID: 20028
- Version: 2.7.1
- Fixed in version: 3.0.0
- Fixed in revision: 19500 (#80b5100b)
- Monitored by: » alexvins (Alexander Shishkin)