mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 11:42:33 +00:00
20 lines
304 B
Nim
20 lines
304 B
Nim
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]
|