mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
* I don't care about observable stores * enforce explicit initializations * cleaner code for the stdlib * stdlib: use explicit initializations * make tests green * algorithm.nim: set result explicitly * remove out parameters and bring the PR into a mergable state * updated the changelog
38 lines
528 B
Nim
38 lines
528 B
Nim
discard """
|
|
nimout: "Warning: use explicit initialization of 'y' for clarity [Uninit]"
|
|
line:34
|
|
action: compile
|
|
"""
|
|
|
|
import strutils
|
|
|
|
{.warning[Uninit]:on.}
|
|
|
|
proc p =
|
|
var x, y, z: int
|
|
if stdin.readLine == "true":
|
|
x = 34
|
|
|
|
while false:
|
|
y = 999
|
|
break
|
|
|
|
while true:
|
|
if x == 12: break
|
|
y = 9999
|
|
|
|
try:
|
|
z = parseInt("1233")
|
|
except Exception:
|
|
case x
|
|
of 34: z = 123
|
|
of 13: z = 34
|
|
else: z = 8
|
|
else:
|
|
y = 3444
|
|
x = 3111
|
|
z = 0
|
|
echo x, y, z
|
|
|
|
p()
|