tthismangle.nim 297 B

123456789101112131415161718192021222324
  1. proc moo1(this: int) =
  2. doAssert this == 42
  3. proc moo2(x: int) =
  4. var this = x
  5. doAssert this == 42
  6. proc moo3() =
  7. for this in [1,1,1]:
  8. doAssert this == 1
  9. proc moo4() =
  10. type
  11. X = object
  12. this: int
  13. var q = X(this: 42)
  14. doAssert q.this == 42
  15. moo1(42)
  16. moo2(42)
  17. moo3()
  18. moo4()