blob: 92759cd151c8e4ef5d97fc2391f8b2cfcbe48010 (
plain)
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
|
const S = struct {
b: u32,
c: i32,
a: struct {
pub fn str(_: @This(), extra: []u32) []i32 {
return @bitCast(extra);
}
},
};
pub export fn entry() void {
var s: S = undefined;
_ = s.a.str(undefined);
}
const S2 = struct {
a: [*c]anyopaque,
};
pub export fn entry2() void {
var s: S2 = undefined;
_ = &s;
}
// error
// backend=selfhosted,llvm
//
// :6:20: error: cannot @bitCast to '[]i32'
// :6:20: note: use @ptrCast to cast from '[]u32'
// :17:12: error: indexable pointer to opaque type 'anyopaque' not allowed
|