mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-28 17:41:45 +00:00
Merge remote-tracking branch 'origin/devel' into pr_so_so
This commit is contained in:
23
tests/iter/t21242_nested_closure_in_iter.nim
Normal file
23
tests/iter/t21242_nested_closure_in_iter.nim
Normal file
@@ -0,0 +1,23 @@
|
||||
# Regression test for bug #21242
|
||||
discard """
|
||||
action: compile
|
||||
"""
|
||||
|
||||
iterator iterSome(): int =
|
||||
proc inner1() =
|
||||
let something = 6
|
||||
proc inner2() =
|
||||
let othersomething = something
|
||||
inner2()
|
||||
|
||||
for n in 0 .. 10:
|
||||
inner1()
|
||||
yield n
|
||||
|
||||
proc test() =
|
||||
proc test1() =
|
||||
for v in iterSome():
|
||||
discard
|
||||
test1()
|
||||
|
||||
test()
|
||||
13
tests/iter/t25704.nim
Normal file
13
tests/iter/t25704.nim
Normal file
@@ -0,0 +1,13 @@
|
||||
import std/[sugar, strutils]
|
||||
|
||||
type Res[T] = tuple[a: int, b: string]
|
||||
iterator test(): Res[string] =
|
||||
yield (1, "")
|
||||
|
||||
for (i, s) in test():
|
||||
static:
|
||||
echo typeof(i)
|
||||
echo typeof(s)
|
||||
let
|
||||
a: int = i
|
||||
b: string = s
|
||||
Reference in New Issue
Block a user