tuninit1.nim 569 B

12345678910111213141516171819202122232425262728293031323334353637
  1. discard """
  2. nimout: "tuninit1.nim(34, 11) Warning: use explicit initialization of 'y' for clarity [Uninit]"
  3. action: compile
  4. """
  5. import strutils
  6. {.experimental: "strictDefs".}
  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()