t9091.nim 456 B

12345678910111213141516171819202122232425262728293031323334
  1. # bug #9091
  2. import streams
  3. block:
  4. type Mine = ref object
  5. a: int
  6. proc write(io: Stream, t: Mine) =
  7. io.write("sure")
  8. let str = newStringStream()
  9. let mi = new Mine
  10. str.write(mi)
  11. str.setPosition 0
  12. doAssert str.readAll == "sure"
  13. block:
  14. type
  15. AObj = object
  16. x: int
  17. proc foo(a: int): string = ""
  18. proc test(args: varargs[string, foo]) =
  19. doAssert false
  20. proc test(a: AObj) =
  21. discard
  22. let x = AObj()
  23. test(x)