mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 08:18:12 +02:00

* ptype.pas, read_named_type, array_dec: allow border checks if both range elements are orddefs; for normal arrays using e.g. "0..15" this will allow to declare the correct amount of elements in the initialization while for generic arrays (e.g. "0..SizeOf(T)") this will mean that only one element can be declared, which was already the case before this change (maybe in such cases a constant initialization should be forbidden in the future...) + added test git-svn-id: trunk@21690 -
19 lines
252 B
ObjectPascal
19 lines
252 B
ObjectPascal
program tw22154;
|
|
|
|
{$MODE DELPHI}
|
|
|
|
type
|
|
TWrapper<T> = class
|
|
procedure Z;
|
|
end;
|
|
|
|
procedure TWrapper<T>.Z;
|
|
const
|
|
A0: array [0..0] of Integer = (0); { OK }
|
|
A1: array [0..1] of Integer = (0, 1); { Comma not exepcted }
|
|
begin
|
|
end;
|
|
|
|
begin
|
|
end.
|