blob: 69778fb366c4324efbc05024a5ac22bd2847617f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
export fn a() void {
var box = Box{ .field = 0 };
_ = &box;
box.*.field = 1;
}
export fn b() void {
var box = Box{ .field = 0 };
const box_ptr = &box;
box_ptr.*.*.field = 1;
}
pub const Box = struct {
field: i32,
};
// error
//
// :4:8: error: cannot dereference non-pointer type 'tmp.Box'
// :11:17: note: struct declared here
// :9:14: error: cannot dereference non-pointer type 'tmp.Box'
// :11:17: note: struct declared here
|