mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 21:38:33 +00:00
add test coverage for fixed bug. closes #5516
This commit is contained in:
parent
680d79ebf9
commit
e778e47140
@ -1568,3 +1568,12 @@ test "@volatileCast without a result location" {
|
||||
try expect(@TypeOf(z) == *i32);
|
||||
try expect(z.* == 1234);
|
||||
}
|
||||
|
||||
test "coercion from single-item pointer to @as to slice" {
|
||||
var x: u32 = 1;
|
||||
|
||||
// Why the following line gets a compile error?
|
||||
const t: []u32 = @as(*[1]u32, &x);
|
||||
|
||||
try expect(t[0] == 1);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user