t17812.nim 382 B

123456789101112131415161718192021222324252627282930
  1. discard """
  2. targets: "c js"
  3. matrix: "--gc:refc; --gc:arc"
  4. """
  5. import std/times
  6. block: # bug #17812
  7. block:
  8. type
  9. Task = object
  10. cb: proc ()
  11. proc hello() = discard
  12. let t = Task(cb: hello)
  13. doAssert t.repr.len > 0
  14. block:
  15. type MyObj = object
  16. field: DateTime
  17. proc `$`(o: MyObj): string = o.repr
  18. doAssert ($MyObj()).len > 0