more checking for 'var T' as return type; refs #7373
This commit is contained in:
parent
88d8a14fb4
commit
6f747674be
4 changed files with 50 additions and 3 deletions
12
tests/varres/tvarres_via_forwarding.nim
Normal file
12
tests/varres/tvarres_via_forwarding.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
discard """
|
||||
line: 10
|
||||
errormsg: "'y' escapes its stack frame; context: 'forward(y)'"
|
||||
"""
|
||||
|
||||
proc forward(x: var int): var int = result = x
|
||||
|
||||
proc foo(): var int =
|
||||
var y = 9
|
||||
result = forward(y)
|
||||
|
||||
echo foo()
|
||||
Loading…
Add table
Add a link
Reference in a new issue