Add a test-case for #1641
This commit is contained in:
parent
b219fc74ad
commit
9570c6e6f4
1 changed files with 20 additions and 0 deletions
20
tests/closure/t1641.nim
Normal file
20
tests/closure/t1641.nim
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
discard """
|
||||||
|
output: '''foo 0
|
||||||
|
bar 0
|
||||||
|
baz'''
|
||||||
|
"""
|
||||||
|
|
||||||
|
# bug #1641
|
||||||
|
proc baz() =
|
||||||
|
echo "baz"
|
||||||
|
|
||||||
|
proc bar(x: int, p: proc()) =
|
||||||
|
echo "bar ", x
|
||||||
|
p()
|
||||||
|
|
||||||
|
proc foo(x: int, p: proc(x: int)) =
|
||||||
|
echo "foo ", x
|
||||||
|
p(x)
|
||||||
|
|
||||||
|
let x = 0
|
||||||
|
x.foo do(x: int): x.bar do(): baz()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue