t17621.nim 269 B

12345678910111213141516
  1. discard """
  2. errormsg: "invalid type: 'lent Test' in this context: 'proc (self: lent Test)' for proc"
  3. """
  4. # bug #17621
  5. {.experimental: "views".}
  6. type Test = ref object
  7. foo: int
  8. proc modify(self: lent Test) =
  9. self.foo += 1
  10. let test = Test(foo: 12)
  11. modify(test)