tconverter_to_string.nim 348 B

1234567891011121314151617181920212223
  1. discard """
  2. output: '''123
  3. c is not nil'''
  4. """
  5. # bug #9149
  6. type
  7. Container = ref object
  8. data: int
  9. converter containerToString*(x: Container): string = $x.data
  10. var c = Container(data: 123)
  11. var str = string c
  12. echo str
  13. if c == nil: # this line can compile on v0.18, but not on 0.19
  14. echo "c is nil"
  15. if not c.isNil:
  16. echo "c is not nil"