twrong_parameter.nim 297 B

1234567891011121314151617
  1. discard """
  2. errormsg: "'x' is not the first parameter; context: 'x.field[0]'"
  3. line: 10
  4. """
  5. type
  6. MyObject = object
  7. field: array[2, int]
  8. proc forward(abc: int; x: var MyObject): var int = result = x.field[0]
  9. proc foo(): var int =
  10. var y: MyObject
  11. result = forward(45, y)
  12. echo foo()