forked from extern/nushell
Fix wrong VarId of $in variable (#7893)
Fixes https://github.com/nushell/nushell/issues/7872
This commit is contained in:
parent
2a9226a55c
commit
3c6b10c6b2
@ -5995,7 +5995,7 @@ fn wrap_expr_with_collect(working_set: &mut StateWorkingSet, expr: &Expression)
|
||||
if let Some(decl_id) = working_set.find_decl(b"collect", &Type::Any) {
|
||||
let mut output = vec![];
|
||||
|
||||
let var_id = working_set.next_var_id();
|
||||
let var_id = IN_VARIABLE_ID;
|
||||
let mut signature = Signature::new("");
|
||||
signature.required_positional.push(PositionalArg {
|
||||
var_id: Some(var_id),
|
||||
|
@ -365,3 +365,9 @@ fn better_operator_spans() -> TestResult {
|
||||
fn range_right_exclusive() -> TestResult {
|
||||
run_test(r#"[1, 4, 5, 8, 9] | range 1..<3 | math sum"#, "9")
|
||||
}
|
||||
|
||||
/// Issue #7872
|
||||
#[test]
|
||||
fn assignment_to_in_var_no_panic() -> TestResult {
|
||||
fail_test(r#"$in = 3"#, "needs to be a mutable variable")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user