mirror of
https://github.com/nushell/nushell.git
synced 2025-05-08 20:14:26 +02:00
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:
parent
a70867ed34
commit
ac36b4a247
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user