This commit is contained in:
Ivan Bondarev 2021-01-05 10:45:39 +01:00
parent 086e75f8e7
commit cd1585fead
2 changed files with 22 additions and 1 deletions

21
TestSuite/records19.pas Normal file
View file

@ -0,0 +1,21 @@
var i: integer;
type
r1 = record
public function InitI1:integer;
begin
Result := 1;
Inc(i);
end;
public i1: integer := InitI1;
public i2: integer;
end;
function f1 := default(r1);
begin
var a := f1;
assert(i = 1);
end.

View file

@ -2129,7 +2129,7 @@ namespace PascalABCCompiler.TreeConverter
{
lbvr.type = SystemLibrary.SystemLibInitializer.TypedSetType.sym_info as type_node;
}
if (vdn.type.is_value_type && userInitalValue is common_constructor_call)
if (vdn.type.is_value_type /*&& userInitalValue is common_constructor_call*/)
{
return new default_operator_node(vdn.type, lid);
}