parent
632af8afad
commit
0869d2a477
4 changed files with 34 additions and 2 deletions
10
tests/stmt/tforloop_tuple_multiple_underscore.nim
Normal file
10
tests/stmt/tforloop_tuple_multiple_underscore.nim
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
discard """
|
||||
errormsg: "undeclared identifier: '_'"
|
||||
"""
|
||||
|
||||
iterator iter(): (int, int, int) =
|
||||
yield (1, 1, 2)
|
||||
|
||||
|
||||
for (_, i, _) in iter():
|
||||
echo _
|
||||
16
tests/stmt/tforloop_tuple_underscore.nim
Normal file
16
tests/stmt/tforloop_tuple_underscore.nim
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
discard """
|
||||
errormsg: "undeclared identifier: '_'"
|
||||
"""
|
||||
|
||||
iterator iter(): (int, int) =
|
||||
yield (1, 2)
|
||||
yield (3, 4)
|
||||
yield (1, 2)
|
||||
yield (3, 4)
|
||||
yield (1, 2)
|
||||
yield (3, 4)
|
||||
|
||||
|
||||
for (_, i) in iter():
|
||||
echo _
|
||||
|
||||
6
tests/stmt/tforloop_underscore.nim
Normal file
6
tests/stmt/tforloop_underscore.nim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
discard """
|
||||
errormsg: "undeclared identifier: '_'"
|
||||
"""
|
||||
|
||||
for _ in ["a"]:
|
||||
echo _
|
||||
Loading…
Add table
Add a link
Reference in a new issue