-
Notifications
You must be signed in to change notification settings - Fork 2.1k
it is somehow a special variable in closure (since 0.92) #12690
Copy link
Copy link
Closed
Labels
A:scoping/name-resolutionHow Nu finds which variables/functions are in scope and to what they are boundHow Nu finds which variables/functions are in scope and to what they are boundcategory:bugSomething isn't workingSomething isn't workingcategory:regressionSomething that worked does not work anymore.Something that worked does not work anymore.
Milestone
Description
Describe the bug
See more info in discussion link.
Discussed in #12440
Originally posted by wdv4758h April 7, 2024
With 0.92, it seems that it is treated differently.
This print 42 in 0.91, but gets error in 0.92.
let tmp = {
let it = 42
print $it
}
do -c $tmperrors in 0.92:
× Missing parameter: $it.
╭─[example.nu:6:1]
5 │
6 │ do -c $tmp
· ─┬
· ╰── missing parameter: $it
╰────This print 42 in both 0.91 and 0.92.
let tmp = {
let x = 42
print $x
}
do -c $tmpHow to reproduce
See above code.
Expected behavior
Works without error.
Screenshots
No response
Configuration
| key | value |
|---|---|
| version | 0.92.3 |
| major | 0 |
| minor | 92 |
| patch | 3 |
| branch | nightly |
| commit_hash | 24ecb84 |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-gnu |
| rust_version | rustc 1.77.2 (25ef9e3d8 2024-04-09) |
| rust_channel | 1.77.2-x86_64-unknown-linux-gnu |
| cargo_version | cargo 1.77.2 (e52e36006 2024-03-26) |
| build_time | 2024-04-28 01:44:34 +00:00 |
| build_rust_channel | release |
| allocator | mimalloc |
| features | dataframe, default, sqlite, static-link-openssl, system-clipboard, trash, which |
| installed_plugins | query |
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:scoping/name-resolutionHow Nu finds which variables/functions are in scope and to what they are boundHow Nu finds which variables/functions are in scope and to what they are boundcategory:bugSomething isn't workingSomething isn't workingcategory:regressionSomething that worked does not work anymore.Something that worked does not work anymore.