blob: cb786f8c8a303fcbfcb0b311eb83d0dcf1088221 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
discard """
cmd: "nim check $file"
action: "reject"
nimout: '''
tlet_uninit3.nim(13, 5) Error: 'let' symbol requires an initialization
tlet_uninit3.nim(19, 5) Error: 'x' cannot be assigned to
tlet_uninit3.nim(23, 11) Error: 'let' symbol requires an initialization
'''
"""
{.experimental: "strictDefs".}
let global {.used.}: int
proc foo() =
block:
let x: int
x = 13
x = 14
block:
let x: int
doAssert x == 0
foo()
|