@@ -12,11 +12,12 @@ stderr:
12
12
error
13
13
-- > test / src / e2e_vm_tests / test_programs / should_fail / type_check_analyze_errors / src / main .sw :5 :14
14
14
|
15
- 3 |
15
+ 3 | fn main () {
16
16
4 | // 0x100 does not fit into a u8
17
17
5 | let _a = 0x100 ;
18
18
| ^^^^^ Literal would overflow because its value does not fit into " u8"
19
19
6 | Vec ::<u8 >::new().push(_a);
20
+ 7 |
20
21
|
21
22
____
22
23
28
29
9 | let _a = 0x10000;
29
30
| ^^^^^^^ Literal would overflow because its value does not fit into "u16"
30
31
10 | Vec::<u16 >::new().push(_a);
32
+ 11 |
31
33
|
32
34
____
33
35
@@ -39,111 +41,16 @@ error
39
41
13 | let _a = 0x100000000;
40
42
| ^^^^^^^^^^^ Literal would overflow because its value does not fit into "u32"
41
43
14 | Vec::<u32 >::new().push(_a);
44
+ 15 |
42
45
|
43
46
____
44
47
45
48
error
46
49
--> test/src/e2e_vm_tests/test_programs/should_fail/type_check_analyze_errors/src/main.sw:20:22
47
50
|
48
- <<<<<<< HEAD
49
51
18 |
50
52
19 | fn insufficient_type_check(arg: u64) -> [u32;2] {
51
53
20 | let res = [1u32 , arg ];
52
- ====== =
53
- 17 |
54
- 18 | // Array - different numerics
55
- 19 | let a = [1 , 2u8 , 3u16 , 4u32 , 5u64 ];
56
- | ^^^^ Mismatched types .
57
- expected : u8
58
- found : u16 .
59
-
60
- 20 |
61
- 21 | // Array - unspecified generic structs
62
- |
63
- ____
64
-
65
- error
66
- -- > test / src / e2e_vm_tests / test_programs / should_fail / type_check_analyze_errors / src / main .sw :19 :28
67
- |
68
- 17 |
69
- 18 | // Array - different numerics
70
- 19 | let a = [1 , 2u8 , 3u16 , 4u32 , 5u64 ];
71
- | ^^^^ Mismatched types .
72
- expected : u8
73
- found : u32 .
74
-
75
- 20 |
76
- 21 | // Array - unspecified generic structs
77
- |
78
- ____
79
-
80
- error
81
- -- > test / src / e2e_vm_tests / test_programs / should_fail / type_check_analyze_errors / src / main .sw :19 :34
82
- |
83
- 17 |
84
- 18 | // Array - different numerics
85
- 19 | let a = [1 , 2u8 , 3u16 , 4u32 , 5u64 ];
86
- | ^^^^ Mismatched types .
87
- expected : u8
88
- found : u64 .
89
-
90
- 20 |
91
- 21 | // Array - unspecified generic structs
92
- |
93
- ____
94
-
95
- error
96
- -- > test / src / e2e_vm_tests / test_programs / should_fail / type_check_analyze_errors / src / main .sw :23 :27
97
- |
98
- 21 | // Array - unspecified generic structs
99
- 22 | let a = [None , Some (1 ), Some (1u8 )];
100
- 23 | let _b : Option <u16 > = a[1];
101
- | ^^^^ Mismatched types.
102
- expected: Option<u16 >
103
- found: Option<u8 >.
104
- help: Variable declaration's type annotation does not match up with the assigned expression's type.
105
- 24 |
106
- 25 | // Wrong cast
107
- |
108
- ____
109
-
110
- error
111
- --> test/src/e2e_vm_tests/test_programs/should_fail/type_check_analyze_errors/src/main.sw:26:25
112
- |
113
- 24 |
114
- 25 | // Wrong cast
115
- 26 | let a = [8, 256u16, 8u8];
116
- | ^^^ Mismatched types.
117
- expected: u16
118
- found: u8.
119
-
120
- 27 | let b: u32 = a[2];
121
- 28 | }
122
- |
123
- ____
124
-
125
- error
126
- --> test/src/e2e_vm_tests/test_programs/should_fail/type_check_analyze_errors/src/main.sw:27:18
127
- |
128
- 25 | // Wrong cast
129
- 26 | let a = [8, 256u16, 8u8];
130
- 27 | let b: u32 = a[2];
131
- | ^^^^ Mismatched types.
132
- expected: u32
133
- found: u16.
134
- help: Variable declaration's type annotation does not match up with the assigned expression's type.
135
- 28 | }
136
- 29 |
137
- |
138
- ____
139
-
140
- error
141
- --> test/src/e2e_vm_tests/test_programs/should_fail/type_check_analyze_errors/src/main.sw:31:22
142
- |
143
- 29 |
144
- 30 | fn insufficient_type_check(arg: u64) -> [u32;2] {
145
- 31 | let res = [1u32 , arg ];
146
- >>>>>> > 911ef0eb7 (fix code snippet for old diagnostics )
147
54
| ^^^ Mismatched types .
148
55
expected : u32
149
56
found : u64 .
@@ -153,45 +60,5 @@ found: u64.
153
60
|
154
61
____
155
62
156
- <<<<<<< HEAD
157
63
Aborting due to 4 errors.
158
- =======
159
- error
160
- --> test/src/e2e_vm_tests/test_programs/should_fail/type_check_analyze_errors/src/main.sw:4:14
161
- |
162
- 2 |
163
- 3 | fn main() {
164
- 4 | let _a = 0x100 ;
165
- | ^^^^^ Literal would overflow because its value does not fit into " u8"
166
- 5 | Vec ::<u8 >::new().push(_a);
167
- 6 |
168
- |
169
- ____
170
-
171
- error
172
- --> test/src/e2e_vm_tests/test_programs/should_fail/type_check_analyze_errors/src/main.sw:8:14
173
- |
174
- 6 |
175
- 7 | // u16
176
- 8 | let _a = 0x10000;
177
- | ^^^^^^^ Literal would overflow because its value does not fit into "u16"
178
- 9 | Vec::<u16 >::new().push(_a);
179
- 10 |
180
- |
181
- ____
182
-
183
- error
184
- --> test/src/e2e_vm_tests/test_programs/should_fail/type_check_analyze_errors/src/main.sw:12:14
185
- |
186
- 10 |
187
- 11 | // u32
188
- 12 | let _a = 0x100000000;
189
- | ^^^^^^^^^^^ Literal would overflow because its value does not fit into "u32"
190
- 13 | Vec::<u32 >::new().push(_a);
191
- 14 |
192
- |
193
- ____
194
-
195
- Aborting due to 12 errors.
196
- >>>>>>> 911ef0eb7 (fix code snippet for old diagnostics)
197
64
error: Failed to compile type_check_analyze_errors
0 commit comments