tuninit1.nim 517 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. discard """
  2. nimout: "Warning: 'y' might not have been initialized [Uninit]"
  3. line:34
  4. action: compile
  5. """
  6. import strutils
  7. {.warning[Uninit]:on.}
  8. proc p =
  9. var x, y, z: int
  10. if stdin.readLine == "true":
  11. x = 34
  12. while false:
  13. y = 999
  14. break
  15. while true:
  16. if x == 12: break
  17. y = 9999
  18. try:
  19. z = parseInt("1233")
  20. except Exception:
  21. case x
  22. of 34: z = 123
  23. of 13: z = 34
  24. else: z = 8
  25. else:
  26. y = 3444
  27. x = 3111
  28. z = 0
  29. echo x, y, z
  30. p()