fixes the 'var T' checking

This commit is contained in:
Andreas Rumpf 2018-03-24 10:10:28 +01:00
commit 299e944cf7
2 changed files with 10 additions and 9 deletions

View file

@ -1,12 +1,16 @@
discard """
line: 6
errormsg: "'x' is not the first parameter; context: 'x'"
line: 10
errormsg: "'x' is not the first parameter; context: 'x.field[0]'"
"""
proc forward(abc: int; x: var int): var int = result = x
type
MyObject = object
field: array[2, int]
proc forward(abc: int; x: var MyObject): var int = result = x.field[0]
proc foo(): var int =
var y = 9
var y: MyObject
result = forward(45, y)
echo foo()