fixes the 'var T' checking
This commit is contained in:
parent
3be4f9111c
commit
299e944cf7
2 changed files with 10 additions and 9 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue