FlatExpression: track nested-lambda closure parameter usage during flattening#545
FlatExpression: track nested-lambda closure parameter usage during flattening#545
Conversation
Agent-Logs-Url: https://github.com/dadhi/FastExpressionCompiler/sessions/92cd188a-ef88-4f30-a837-32e0c40e9a1a Co-authored-by: dadhi <39516+dadhi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dadhi/FastExpressionCompiler/sessions/92cd188a-ef88-4f30-a837-32e0c40e9a1a Co-authored-by: dadhi <39516+dadhi@users.noreply.github.com>
|
@copilot we are using short indexes in FE no need for int, apply stuct layout too. |
Agent-Logs-Url: https://github.com/dadhi/FastExpressionCompiler/sessions/775f1746-e6c9-4aef-8b08-84f5734431e5 Co-authored-by: dadhi <39516+dadhi@users.noreply.github.com>
Updated in commit |
dadhi
left a comment
There was a problem hiding this comment.
There are warnings and errors to fix in ci:
Warning: /home/runner/work/FastExpressionCompiler/FastExpressionCompiler/test/FastExpressionCompiler.IssueTests/Issue500_IndexOutOfRangeException_with_value_objects_implicit_conversions.cs(27,85): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. [/home/runner/work/FastExpressionCompiler/FastExpressionCompiler/test/FastExpressionCompiler.IssueTests/FastExpressionCompiler.IssueTests.csproj::TargetFramework=net8.0]
Warning: /home/runner/work/FastExpressionCompiler/FastExpressionCompiler/test/FastExpressionCompiler.IssueTests/Issue500_IndexOutOfRangeException_with_value_objects_implicit_conversions.cs(67,80): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. [/home/runner/work/FastExpressionCompiler/FastExpressionCompiler/test/FastExpressionCompiler.IssueTests/FastExpressionCompiler.IssueTests.csproj::TargetFramework=net8.0]
Error: /home/runner/work/FastExpressionCompiler/FastExpressionCompiler/src/FastExpressionCompiler.LightExpression/FlatExpression.cs(58,12): error CS1591: Missing XML comment for publicly visible type or member 'LambdaClosureParameterUsage.LambdaClosureParameterUsage(short, short)' [/home/runner/work/FastExpressionCompiler/FastExpressionCompiler/src/FastExpressionCompiler.LightExpression/FastExpressionCompiler.LightExpression.csproj::TargetFramework=net472]
|
@codex please setup env and proceed work on it |
|
To use Codex here, create an environment for this repo. |
|
@codex Env is created |
FlatExpression already indexed structural nodes (lambdas/blocks/gotos/labels/try), but did not record per-lambda captured parameter usage needed for closure-aware nested-lambda handling. This PR adds closure-usage metadata at construction time so nested lambda capture information is available without a separate traversal.
New closure-usage metadata in
ExprTreeLambdaClosureParameterUsage(LambdaNodeIndex,ParameterId).ExprTree.LambdaClosureParameterUsagesto store captured-parameter mappings per lambda node.Capture analysis wired into
FromExpressionlambda constructionExpressionType.Lambda, collect parameters referenced by the lambda body that are:ParameterExpression.Focused unit coverage