tupcomingfeatures.nim 407 B

123456789101112131415161718192021222324252627282930313233343536
  1. discard """
  2. output: '''0 -2 0
  3. 0 -2'''
  4. """
  5. {.this: self.}
  6. type
  7. Foo = object
  8. a, b, x: int
  9. proc yay(self: Foo) =
  10. echo a, " ", b, " ", x
  11. proc footest[T](self: var Foo, a: T) =
  12. b = 1+a
  13. yay()
  14. proc nongeneric(self: Foo) =
  15. echo a, " ", b
  16. var ff: Foo
  17. footest(ff, -3)
  18. ff.nongeneric
  19. {.experimental.}
  20. using
  21. c: Foo
  22. x, y: int
  23. proc usesSig(c) =
  24. echo "yummy"
  25. proc foobar(c, y) =
  26. echo "yay"