ITupleNode signature change

This commit is contained in:
Michael Schimmel
2026-01-06 11:37:18 +01:00
parent 264314cd93
commit 40ed51aef8
23 changed files with 340 additions and 270 deletions
+6 -5
View File
@@ -195,7 +195,6 @@ function TUpvalueAnalyzer.VisitLambdaExpression(const Node: IAstNode): IAstNode;
var
L: ILambdaExpressionNode;
i: Integer;
paramTuple: ITupleNode;
begin
L := Node.AsLambdaExpression;
@@ -205,11 +204,13 @@ begin
// 2. Register parameters (they mask outer variables)
// We pass 'nil' as the node because we currently don't box parameters,
// but we must ensure Resolve() finds them so we don't accidentally box a shadowed variable.
paramTuple := L.Parameters;
for i := 0 to paramTuple.Count - 1 do
// Optimized: Access Elements array directly
var paramElements := L.Parameters.Elements;
for i := 0 to High(paramElements) do
begin
if paramTuple.Items[i].Kind = akIdentifier then
FCurrentScope.Define(paramTuple.Items[i].AsIdentifier.Name, nil);
if paramElements[i].Kind = akIdentifier then
FCurrentScope.Define(paramElements[i].AsIdentifier.Name, nil);
end;
// 3. Visit Body