This commit is contained in:
Ivan Bondarev 2023-11-04 20:12:55 +01:00
parent 5db41ff65f
commit 8bbc009888
2 changed files with 14 additions and 4 deletions

10
TestSuite/delegates22.pas Normal file
View file

@ -0,0 +1,10 @@
procedure pr1(act: (sequence of integer)-> ());
begin
act(Arr(1,2,3));
end;
var l: integer;
begin
pr1(x-> begin l := x.Count end);
assert(l = 3);
end.

View file

@ -21079,8 +21079,8 @@ namespace PascalABCCompiler.TreeConverter
if (en.enumerators[i].value != null)
AddError(get_location(en.enumerators[i].name), "ONE_TKIDENTIFIER");
if (!(en.enumerators[i].name is named_type_reference) && !(en.enumerators[i].name is array_type))
AddError(get_location(en.enumerators[i].name), "ONE_TKIDENTIFIER");
//if (!(en.enumerators[i].name is named_type_reference) && !(en.enumerators[i].name is array_type))
// AddError(get_location(en.enumerators[i].name), "ONE_TKIDENTIFIER");
t.Add(en.enumerators[i].name); // ???????????????
}
@ -21109,8 +21109,8 @@ namespace PascalABCCompiler.TreeConverter
if (en.enumerators[i].value != null)
AddError(get_location(en.enumerators[i].name), "ONE_TKIDENTIFIER");
if (!(en.enumerators[i].name is named_type_reference) && !(en.enumerators[i].name is array_type))
AddError(get_location(en.enumerators[i].name), "ONE_TKIDENTIFIER");
//if (!(en.enumerators[i].name is named_type_reference) && !(en.enumerators[i].name is array_type))
// AddError(get_location(en.enumerators[i].name), "ONE_TKIDENTIFIER");
t.Add(en.enumerators[i].name);
}