This commit is contained in:
Andreas Rumpf 2019-08-23 18:58:55 +02:00 • committed by GitHub
commit fbb2763204
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 13 deletions

View file

@ -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)