This commit is contained in:
Bung
2023-08-27 22:56:50 +08:00
committed by GitHub
parent 0b78b7f595
commit 100eb6820c

19
tests/closure/t9334.nim Normal file
View File

@@ -0,0 +1,19 @@
discard """
cmd: "nim $target --hints:off $options -r $file"
nimout: '''@[1]
@[1, 1]
'''
nimoutFull: true
"""
proc p(s: var seq[int]): auto =
let sptr = addr s
return proc() = sptr[].add 1
proc f =
var data = @[1]
p(data)()
echo repr data
static:
f() # prints [1]
f() # prints [1, 1]