mirror of
https://github.com/ziglang/zig.git
synced 2025-12-12 09:13:11 +00:00
Add a test case
Co-authored-with: Vexu <git@vexu.eu>
This commit is contained in:
parent
561565fa81
commit
bbfa3550a0
@ -752,3 +752,10 @@ test "extern variable with non-pointer opaque type" {
|
|||||||
@export(var_to_export, .{ .name = "opaque_extern_var" });
|
@export(var_to_export, .{ .name = "opaque_extern_var" });
|
||||||
expect(@ptrCast(*align(1) u32, &opaque_extern_var).* == 42);
|
expect(@ptrCast(*align(1) u32, &opaque_extern_var).* == 42);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "lazy typeInfo value as generic parameter" {
|
||||||
|
const S = struct {
|
||||||
|
fn foo(args: anytype) void {}
|
||||||
|
};
|
||||||
|
S.foo(@typeInfo(@TypeOf(.{})));
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user