Bug
Function calls inside a ClosedExpression are not resolved using the same function catalog/binding context as function calls inside an OpenExpression.
Reproduction
The equivalent nested function call binds successfully when represented as an OpenExpression:
.\expressif bind 'even |or greater-than(add(17))'
Result:
OpenExpression
└─ Function: or
├─ Arg[0]: OpenExpression
│ └─ Function: even
└─ Arg[1]: OpenExpression
└─ Function: greater-than
└─ Arg[0]: OpenExpression
└─ Function: add
└─ Arg[0]: Literal = 17
But the same function call fails when it is part of a ClosedExpression:
.\expressif bind 'even |or greater-than(45 | add(17))'
Result:
The parser correctly produces a ClosedExpression:
.\expressif parse 'even |or greater-than(45 | add(17))'
OpenExpression
└─ BinaryExpression
├─ FunctionCall: even
├─ BinaryOperator: OR
└─ FunctionCall: greater-than
└─ PositionalArgument
└─ ClosedExpression
├─ NumericLiteral: 45
└─ FunctionCall: add
└─ PositionalArgument
└─ NumericLiteral: 17
Expected behavior
Function calls nested inside a ClosedExpression should be resolved through the same function catalog and binding context as function calls nested inside an OpenExpression.
The following should therefore bind successfully:
greater-than(45 | add(17))
and add should resolve to the same bound function implementation as it does in:
Scope
- Ensure
ClosedExpression binding carries the same function catalog/resolution context as OpenExpression binding.
- Add regression tests covering function calls nested in closed expressions.
- Include at least one comparison showing equivalent function resolution in open and closed expression arguments.
Bug
Function calls inside a
ClosedExpressionare not resolved using the same function catalog/binding context as function calls inside anOpenExpression.Reproduction
The equivalent nested function call binds successfully when represented as an
OpenExpression:.\expressif bind 'even |or greater-than(add(17))'Result:
But the same function call fails when it is part of a
ClosedExpression:.\expressif bind 'even |or greater-than(45 | add(17))'Result:
The parser correctly produces a
ClosedExpression:.\expressif parse 'even |or greater-than(45 | add(17))'Expected behavior
Function calls nested inside a
ClosedExpressionshould be resolved through the same function catalog and binding context as function calls nested inside anOpenExpression.The following should therefore bind successfully:
and
addshould resolve to the same bound function implementation as it does in:Scope
ClosedExpressionbinding carries the same function catalog/resolution context asOpenExpressionbinding.