-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In for loop _
is accessible
#15972
Comments
Feature. |
agreed; but should be documented (maybe it is, haven't found it) |
@timotheecour why is this a feature, does it not defeat the purpose of |
my bad, i misread accessible as inaccessible. when true:
let (_, a, _) = (1,2,3)
echo _ # Error: undeclared identifier: '_'
when true:
let _ = 1
echo _ # Error: undeclared identifier: '_' |
Ah, thanks. Thought I was losing my mind after both you and disruptek said it's a feature. |
How about this? block _:
echo "123"
break _ I would expect this to error too.
|
* fix nim-lang#15972 * add testcase * more
* fix nim-lang#15972 * add testcase * more
Unlike pretty much anywhere else
_
is accessible as a single parameter in a for loop.Example
Current Output
Expected Output
Tested on pretty much all Nim versions.
The text was updated successfully, but these errors were encountered: