summary refs log tree commit diff stats
path: root/tests/varres/twrong_parameter.nim
blob: 58d01fd7e18fce24972931725fe4eeb65d5629e0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
discard """
  errormsg: "'x' is not the first parameter; context: 'x.field[0]'"
  line: 10
"""

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: MyObject
  result = forward(45, y)

echo foo()