teffects4.nim 330 B

123456789101112131415161718192021222324
  1. discard """
  2. errormsg: "type mismatch"
  3. line: 23
  4. """
  5. type
  6. TObj {.pure, inheritable.} = object
  7. TObjB = object of TObj
  8. a, b, c: string
  9. fn: proc (): int {.tags: [ReadIOEffect].}
  10. proc q() {.tags: [IoEffect].} =
  11. discard
  12. proc raiser(): int =
  13. writeLine stdout, "arg"
  14. if true:
  15. q()
  16. var o: TObjB
  17. o.fn = raiser