enforce 'var T' produces a view into the first parameter; refs #7373

This commit is contained in:
Andreas Rumpf 2018-03-24 09:41:04 +01:00
commit 3be4f9111c
2 changed files with 19 additions and 4 deletions

View file

@ -0,0 +1,12 @@
discard """
line: 6
errormsg: "'x' is not the first parameter; context: 'x'"
"""
proc forward(abc: int; x: var int): var int = result = x
proc foo(): var int =
var y = 9
result = forward(45, y)
echo foo()