Repository navigation
Conversation
Thorium
commented
Nov 19, 2026
- Patterns.evaluateExpression reads a query's one-off values (constants, members, method calls on captured values, conversions, quotes) by reflection and interprets the rest, in place of Expression.Lambda(e).Compile().
- QueryExpression.CompiledLambdas compiles a row reader once per shape and binds each run's constants into it. Not used where the runtime interprets lambdas (IsDynamicCodeSupported false).
- Exceptions from a captured value are raised unwrapped.
- Patterns.evaluateExpression reads a query's one-off values (constants, members, method calls on captured values, conversions, quotes) by reflection and interprets the rest, in place of Expression.Lambda(e).Compile(). - QueryExpression.CompiledLambdas compiles a row reader once per shape and binds each run's constants into it. Not used where the runtime interprets lambdas (IsDynamicCodeSupported false). - Exceptions from a captured value are raised unwrapped.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
There was a problem hiding this comment.
🟡 Changes recommended
Two critical cache-key defects remain: member mappings in NewExpression projections and declared lambda parameter order are omitted or misrepresented, allowing distinct expressions to reuse the wrong compiled factory.
2 open issues
Review effort: Lite
| let parameters = Dictionary<ParameterExpression, int>(HashIdentity.Reference) | ||
| let positionOf (p: ParameterExpression) = | ||
| match parameters.TryGetValue p with | ||
| | true, i -> i | ||
| | false, _ -> | ||
| parameters.Add(p, parameters.Count) | ||
| parameters.Count - 1 |
There was a problem hiding this comment.
Not a collision. ExpressionVisitor visits a lambda’s parameter list after its body, so the declaration order is in the key: a - b gives body 0 1, declarations 0 1; b - a gives body 0 1, declarations 1 0. The test lambdas of other shapes are not mixed up asserts 7 and -7 for this case and passes in CI.
| | :? NewExpression as n -> | ||
| add n.Constructor | ||
| add (box n.Arguments.Count) | ||
| true |
There was a problem hiding this comment.
Members doesn’t change the compiled delegate: the compiler emits newobj from the constructor and the arguments only. Two NewExpressions with one constructor and different member lists compile to the same code, so sharing a factory is correct.
