Repository navigation
Expand file tree
/
Copy pathtreturns.nim
More file actions
106 lines (87 loc) · 2.53 KB
/
Copy pathtreturns.nim
File metadata and controls
106 lines (87 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{.experimental: "strictdefs".}
type Test = object
id: int
proc foo {.noreturn.} = discard
proc test1(): Test =
if true: #[tt.Warning
^ Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]]#
return Test()
else:
return
proc test0(): Test =
if true: #[tt.Warning
^ Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]]#
return
else:
foo()
proc test2(): Test =
if true: #[tt.Warning
^ Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]]#
return
else:
return
proc test3(): Test =
if true: #[tt.Warning
^ Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]]#
return
else:
return Test()
proc test4(): Test =
if true: #[tt.Warning
^ Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]]#
return
else:
result = Test()
return
proc test5(x: bool): Test =
case x: #[tt.Warning
^ Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]]#
of true:
return
else:
return Test()
proc test6(x: bool): Test =
case x: #[tt.Warning
^ Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]]#
of true:
return
else:
return
proc test7(x: bool): Test =
case x: #[tt.Warning
^ Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]]#
of true:
return
else:
discard
proc test8(x: bool): Test =
case x: #[tt.Warning
^ Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]]#
of true:
discard
else:
raise
proc hasImportStmt(): bool =
if false: #[tt.Warning
^ Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]]#
return true
else:
discard
discard hasImportStmt()
block:
proc hasImportStmt(): bool =
if false: #[tt.Warning
^ Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]]#
return true
else:
return
discard hasImportStmt()
block:
block:
proc foo(x: var int) =
discard
proc main =
var s: int
foo(s)#[tt.Warning
^ use explicit initialization of 's' for clarity [Uninit]]#
main()