This commit is contained in:
Ivan Bondarev 2022-07-24 13:52:14 +02:00
parent 87fba1e0c8
commit 8a9a56f989
2 changed files with 18 additions and 0 deletions

View file

@ -46374,6 +46374,7 @@ namespace PascalABCCompiler.SyntaxTree
{
yield_unknown_ident copy = new yield_unknown_ident();
copy.Parent = this.Parent;
copy.UnknownID = this.UnknownID;
if (source_context != null)
copy.source_context = new SourceContext(source_context);
if (attributes != null)

17
TestSuite/yield6.pas Normal file
View file

@ -0,0 +1,17 @@
type
t1 = class
function f1: sequence of byte;
begin
var p: function: sequence of integer := ()->
|(1,2)|.Select(\(a,b)->3);
yield p().ToArray()[0];
end;
end;
begin
var o := new t1;
assert(o.f1.ToArray[0] = 3);
end.