zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit bbfa3550a02e82df91f5e2fafeab564906ae943c (tree)
parent 561565fa81e4107f50b8cbdcc00ec0fa2ee4de15
Author: LemonBoy <thatlemon@gmail.com>
Date:   Mon, 14 Dec 2020 17:39:35 +0100

Add a test case

Co-authored-with: Vexu <git@vexu.eu>

Diffstat:
Mtest/stage1/behavior/misc.zig | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/test/stage1/behavior/misc.zig b/test/stage1/behavior/misc.zig @@ -752,3 +752,10 @@ test "extern variable with non-pointer opaque type" { @export(var_to_export, .{ .name = "opaque_extern_var" }); 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(.{}))); +}