File tree 1 file changed +15
-6
lines changed
test/cases/compile_errors
1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change 1
- const A = struct { x : i32 , };
1
+ const A = struct { x : i32 };
2
2
export fn f () void {
3
- var a : A = undefined ;
3
+ var a : A = undefined ;
4
4
a .foo = 1 ;
5
5
const y = a .bar ;
6
6
_ = y ;
7
7
}
8
8
export fn g () void {
9
- var a : A = undefined ;
9
+ var a : A = undefined ;
10
10
const y = a .bar ;
11
11
_ = y ;
12
12
}
13
+ export fn e () void {
14
+ const B = struct {
15
+ fn f () void {}
16
+ };
17
+ const b : B = undefined ;
18
+ @import ("std" ).debug .print ("{}{}" , .{ b .f , b .f });
19
+ }
13
20
14
21
// error
15
22
// backend=stage2
16
23
// target=native
17
24
//
18
- // :4:7: error: no field named 'foo' in struct 'tmp .A'
25
+ // :4:7: error: no field named 'foo' in struct 'invalid_struct_field .A'
19
26
// :1:11: note: struct declared here
20
- // :10:17: error: no field named 'bar' in struct 'tmp.A'
21
-
27
+ // :10:17: error: no field named 'bar' in struct 'invalid_struct_field.A'
28
+ // :1:11: note: struct declared here
29
+ // :18:45: error: no field named 'f' in struct 'invalid_struct_field.e.B'
30
+ // :14:16: note: struct declared here
You can’t perform that action at this time.
0 commit comments