-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
nil_to_option_err.out
34 lines (34 loc) · 1.1 KB
/
nil_to_option_err.out
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
vlib/v/checker/tests/nil_to_option_err.vv:8:7: warning: cannot assign a reference to a value (this will be an error soon) left=int false right=nil true ptr=false
6 | fn main() {
7 | mut a := ?int(none)
8 | a = unsafe { nil }
| ^
9 |
10 | mut b := Test{}
vlib/v/checker/tests/nil_to_option_err.vv:7:9: warning: unused variable: `a`
5 |
6 | fn main() {
7 | mut a := ?int(none)
| ^
8 | a = unsafe { nil }
9 |
vlib/v/checker/tests/nil_to_option_err.vv:3:7: error: cannot assign `nil` to a non-pointer field
1 | struct Test {
2 | mut:
3 | a ?int = unsafe { nil }
| ~~~~
4 | }
5 |
vlib/v/checker/tests/nil_to_option_err.vv:8:9: error: cannot assign `nil` to option value
6 | fn main() {
7 | mut a := ?int(none)
8 | a = unsafe { nil }
| ~~~~~~
9 |
10 | mut b := Test{}
vlib/v/checker/tests/nil_to_option_err.vv:11:11: error: cannot assign `nil` to option value
9 |
10 | mut b := Test{}
11 | b.a = unsafe { nil }
| ~~~~~~
12 | }