tambsym2.nim 298 B

12345678910111213141516171819202122
  1. discard """
  2. output: "7"
  3. """
  4. # Test overloading of procs with locals
  5. type
  6. TMyType = object
  7. len: int
  8. data: string
  9. proc len(x: TMyType): int {.inline.} = return x.len
  10. proc x(s: TMyType, len: int) =
  11. writeLine(stdout, len(s))
  12. var
  13. m: TMyType
  14. m.len = 7
  15. m.data = "1234"
  16. x(m, 5) #OUT 7