t9091.nim 508 B

12345678910111213141516171819202122232425262728293031323334353637
  1. discard """
  2. targets: "c"
  3. output: "test AObj"
  4. action: "compile"
  5. exitcode: 0
  6. timeout: 60.0
  7. """
  8. import streams
  9. block:
  10. type Mine = ref object
  11. a: int
  12. proc write(io: Stream, t: Mine) =
  13. io.write("sure")
  14. let str = newStringStream()
  15. let mi = new Mine
  16. str.write(mi)
  17. block:
  18. type
  19. AObj = object
  20. x: int
  21. proc foo(a: int): string = ""
  22. proc test(args: varargs[string, foo]) =
  23. echo "varargs"
  24. proc test(a: AObj) =
  25. echo "test AObj"
  26. let x = AObj()
  27. test(x)