summary refs log blame commit diff stats
path: root/tests/system/trefs.nim
blob: 8c36aec523b5f24e01136e9826e79e57548a3bdf (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                 
discard """
  targets: "c js"
"""

# bug #21317
proc parseHook*(v: var ref int) =
  var a: ref int
  new(a)
  a[] = 123
  v = a

proc fromJson2*(): ref int =
  parseHook(result)

doAssert fromJson2()[] == 123