This commit is contained in:
Araq 2015-01-10 23:37:05 +01:00
commit 27141f6016
2 changed files with 53 additions and 6 deletions

View file

@ -0,0 +1,31 @@
discard """
ccodecheck: "!@('{' \\s* 'NI HEX3Astate;' \\s* '}')"
"""
# bug #1803
type TaskFn = iterator (): float
iterator a1(): float {.closure.} =
var k = 10
while k > 0:
echo "a1 ", k
dec k
yield 1.0
iterator a2(): float {.closure.} =
var k = 15
while k > 0:
echo "a2 ", k
dec k
yield 2.0
var
x = a1
y = a2
z: TaskFn
discard x()
z = x #shallowCopy(z, x)
z = y #shallowCopy(z, y)
discard x()