fix: Further limit expressions that are accepted as a closure

- Only variables and cell-path accesses on variables are allowed as
  closures. These can't be `$it` or a path on `$it`
- Any other expression falls back to the usual RowCondition expression
This commit is contained in:
Bahex 2025-05-06 11:27:34 +03:00
parent a70867ed34
commit ac36b4a247

View File

@ -3613,7 +3613,7 @@ pub fn parse_row_condition(working_set: &mut StateWorkingSet, spans: &[Span]) ->
let block_id = match expression.expr {
Expr::Block(block_id) => block_id,
Expr::Closure(block_id) => block_id,
Expr::FullCellPath(ref box_fcp) if box_fcp.head.as_var() != Some(var_id) => {
Expr::FullCellPath(ref box_fcp) if box_fcp.head.as_var().is_some_and(|id| id != var_id) => {
let mut expression = expression;
expression.ty = Type::Any;
return expression;