trefs.nim 209 B

12345678910111213141516
  1. discard """
  2. targets: "c js"
  3. """
  4. # bug #21317
  5. proc parseHook*(v: var ref int) =
  6. var a: ref int
  7. new(a)
  8. a[] = 123
  9. v = a
  10. proc fromJson2*(): ref int =
  11. parseHook(result)
  12. doAssert fromJson2()[] == 123