Skip to content

Commit f1a28d3

Browse files
committed
rebase
1 parent 72c99ed commit f1a28d3

File tree

2 files changed

+16
-146
lines changed
  • test/src/e2e_vm_tests/test_programs/should_fail

2 files changed

+16
-146
lines changed

test/src/e2e_vm_tests/test_programs/should_fail/array_wrong_elements_types/stdout.snap

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ stderr:
1212
error
1313
--> test/src/e2e_vm_tests/test_programs/should_fail/array_wrong_elements_types/src/main.sw:41:27
1414
|
15-
39 |
15+
39 | // unexpected Option<u8>
1616
40 | let a = [None, Some(1), Some(1u8)];
1717
41 | let _b: Option<u16> = a[1];
1818
| ^^^^ Mismatched types.
@@ -27,7 +27,7 @@ ____
2727
error
2828
--> test/src/e2e_vm_tests/test_programs/should_fail/array_wrong_elements_types/src/main.sw:45:18
2929
|
30-
43 |
30+
43 | // unexpected u8
3131
44 | let a = [8, 256u16, 8u8];
3232
45 | let b: u32 = a[2];
3333
| ^^^^ Mismatched types.
@@ -42,7 +42,7 @@ ____
4242
error
4343
--> test/src/e2e_vm_tests/test_programs/should_fail/array_wrong_elements_types/src/main.sw:9:22
4444
|
45-
7 |
45+
7 | fn main() {
4646
8 | // unexpected u16
4747
9 | let a: [u8;1] = [1u16];
4848
| ^^^^ Mismatched types.
@@ -65,13 +65,14 @@ expected: u8
6565
found: u16.
6666

6767
13 | let a = [1, 2u8, 3u16, 4u32, 5u64];
68+
14 |
6869
|
6970
____
7071

7172
error
7273
--> test/src/e2e_vm_tests/test_programs/should_fail/array_wrong_elements_types/src/main.sw:13:22
7374
|
74-
11 |
75+
11 | // unexpected u16
7576
12 | let _ = [1u8, 1u16];
7677
13 | let a = [1, 2u8, 3u16, 4u32, 5u64];
7778
| ^^^^ Mismatched types.
@@ -86,7 +87,7 @@ ____
8687
error
8788
--> test/src/e2e_vm_tests/test_programs/should_fail/array_wrong_elements_types/src/main.sw:13:28
8889
|
89-
11 |
90+
11 | // unexpected u16
9091
12 | let _ = [1u8, 1u16];
9192
13 | let a = [1, 2u8, 3u16, 4u32, 5u64];
9293
| ^^^^ Mismatched types.
@@ -101,7 +102,7 @@ ____
101102
error
102103
--> test/src/e2e_vm_tests/test_programs/should_fail/array_wrong_elements_types/src/main.sw:13:34
103104
|
104-
11 |
105+
11 | // unexpected u16
105106
12 | let _ = [1u8, 1u16];
106107
13 | let a = [1, 2u8, 3u16, 4u32, 5u64];
107108
| ^^^^ Mismatched types.
@@ -221,7 +222,7 @@ ____
221222
error
222223
--> test/src/e2e_vm_tests/test_programs/should_fail/array_wrong_elements_types/src/main.sw:32:20
223224
|
224-
30 |
225+
30 | // unexpected str
225226
31 | let _ = [1, "", 1u16];
226227
32 | let _ = [1, 2, "hello"];
227228
| ^^^^^^^ Mismatched types.
@@ -236,21 +237,22 @@ ____
236237
error
237238
--> test/src/e2e_vm_tests/test_programs/should_fail/array_wrong_elements_types/src/main.sw:33:25
238239
|
239-
31 |
240+
31 | let _ = [1, "", 1u16];
240241
32 | let _ = [1, 2, "hello"];
241242
33 | let _ = [1, return, "", 1u16];
242243
| ^^ Mismatched types.
243244
expected: u16
244245
found: str.
245246

246247
34 | let _ = [1, "", return, 1u16];
248+
35 |
247249
|
248250
____
249251

250252
error
251253
--> test/src/e2e_vm_tests/test_programs/should_fail/array_wrong_elements_types/src/main.sw:34:17
252254
|
253-
32 |
255+
32 | let _ = [1, 2, "hello"];
254256
33 | let _ = [1, return, "", 1u16];
255257
34 | let _ = [1, "", return, 1u16];
256258
| ^^ Mismatched types.
@@ -288,6 +290,7 @@ expected: u16
288290
found: u8.
289291

290292
45 | let b: u32 = a[2];
293+
46 |
291294
|
292295
____
293296

test/src/e2e_vm_tests/test_programs/should_fail/type_check_analyze_errors/stdout.snap

Lines changed: 4 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ stderr:
1212
error
1313
--> test/src/e2e_vm_tests/test_programs/should_fail/type_check_analyze_errors/src/main.sw:5:14
1414
|
15-
3 |
15+
3 | fn main() {
1616
4 | // 0x100 does not fit into a u8
1717
5 | let _a = 0x100;
1818
| ^^^^^ Literal would overflow because its value does not fit into "u8"
1919
6 | Vec::<u8>::new().push(_a);
20+
7 |
2021
|
2122
____
2223

@@ -28,6 +29,7 @@ error
2829
9 | let _a = 0x10000;
2930
| ^^^^^^^ Literal would overflow because its value does not fit into "u16"
3031
10 | Vec::<u16>::new().push(_a);
32+
11 |
3133
|
3234
____
3335

@@ -39,111 +41,16 @@ error
3941
13 | let _a = 0x100000000;
4042
| ^^^^^^^^^^^ Literal would overflow because its value does not fit into "u32"
4143
14 | Vec::<u32>::new().push(_a);
44+
15 |
4245
|
4346
____
4447

4548
error
4649
--> test/src/e2e_vm_tests/test_programs/should_fail/type_check_analyze_errors/src/main.sw:20:22
4750
|
48-
<<<<<<< HEAD
4951
18 |
5052
19 | fn insufficient_type_check(arg: u64) -> [u32;2] {
5153
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)
14754
| ^^^ Mismatched types.
14855
expected: u32
14956
found: u64.
@@ -153,45 +60,5 @@ found: u64.
15360
|
15461
____
15562

156-
<<<<<<< HEAD
15763
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)
19764
error: Failed to compile type_check_analyze_errors

0 commit comments

Comments
 (0)