tvarres_via_forwarding.nim 209 B

12345678910111213
  1. discard """
  2. errormsg: "'y' escapes its stack frame; context: 'forward(y)'"
  3. line: 10
  4. """
  5. proc forward(x: var int): var int = result = x
  6. proc foo(): var int =
  7. var y = 9
  8. result = forward(y)
  9. echo foo()