This commit is contained in:
parent
589d4b4493
commit
ff55c29fee
11
TestSuite/classconst3.pas
Normal file
11
TestSuite/classconst3.pas
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
type
|
||||||
|
TClass = class
|
||||||
|
public const b: array of string = ('abc','def');
|
||||||
|
public const s: string = 'tt';
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
assert(TClass.b[0] = 'abc');
|
||||||
|
assert(TClass.b[1] = 'def');
|
||||||
|
assert(TClass.s = 'tt');
|
||||||
|
end.
|
||||||
|
|
@ -11474,7 +11474,7 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
cdn.const_value = convert_strong_to_constant_node(_typed_const_definition.const_value, tn);
|
cdn.const_value = convert_strong_to_constant_node(_typed_const_definition.const_value, tn);
|
||||||
const_def_type = null;
|
const_def_type = null;
|
||||||
is_typed_const_def = false;
|
is_typed_const_def = false;
|
||||||
if (cdn is class_constant_definition && cdn.constant_value.value == null)
|
if (cdn is class_constant_definition && (cdn.constant_value.value == null && !(cdn.constant_value is array_const)))
|
||||||
AddError(new NotSupportedError(cons_loc));
|
AddError(new NotSupportedError(cons_loc));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue