This commit is contained in:
Ivan Bondarev 2021-04-05 14:39:02 +02:00
parent 589d4b4493
commit ff55c29fee
2 changed files with 12 additions and 1 deletions

11
TestSuite/classconst3.pas Normal file
View 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.

View file

@ -11474,7 +11474,7 @@ namespace PascalABCCompiler.TreeConverter
cdn.const_value = convert_strong_to_constant_node(_typed_const_definition.const_value, tn);
const_def_type = null;
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));
}