tnotnil2.nim 288 B

12345678910111213141516171819202122232425
  1. discard """
  2. errormsg: "cannot prove 'y' is not nil"
  3. line:20
  4. """
  5. import strutils
  6. {.experimental: "notnil".}
  7. type
  8. TObj = object
  9. x, y: int
  10. proc q(x: pointer not nil) =
  11. discard
  12. proc p() =
  13. var x: pointer
  14. let y = x
  15. if not y.isNil or y != x:
  16. q(y)
  17. else:
  18. q(y)
  19. p()