parent
b07694cd90
commit
fbb2763204
2 changed files with 46 additions and 13 deletions
|
|
@ -1,5 +1,7 @@
|
|||
discard """
|
||||
output: '''(x: "string here", a: 1)'''
|
||||
output: '''(x: "string here", a: 1)
|
||||
b is 5
|
||||
x is 12'''
|
||||
"""
|
||||
|
||||
proc simple[T](a: T) =
|
||||
|
|
@ -28,3 +30,35 @@ proc test(baz: int, qux: var int): int =
|
|||
|
||||
var x1 = 456
|
||||
discard test(123, x1)
|
||||
|
||||
# bug #11958
|
||||
proc foo() =
|
||||
var a = 5
|
||||
proc bar() {.nimcall.} =
|
||||
var b = 5
|
||||
for k, v in fieldpairs(locals()):
|
||||
echo k, " is ", v
|
||||
|
||||
bar()
|
||||
foo()
|
||||
|
||||
|
||||
proc foo2() =
|
||||
var a = 5
|
||||
proc bar2() {.nimcall.} =
|
||||
for k, v in fieldpairs(locals()):
|
||||
echo k, " is ", v
|
||||
|
||||
bar2()
|
||||
foo2()
|
||||
|
||||
|
||||
proc foo3[T](y: T) =
|
||||
var a = 5
|
||||
proc bar2[T](x: T) {.nimcall.} =
|
||||
for k, v in fieldpairs(locals()):
|
||||
echo k, " is ", v
|
||||
|
||||
bar2(y)
|
||||
|
||||
foo3(12)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue