From 357813b1930579af2ba3b5004131ac9f3f80ba57 Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Fri, 8 Mar 2019 13:42:55 +0100 Subject: [PATCH] added tests --- test/stage1/behavior/type_info.zig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/stage1/behavior/type_info.zig b/test/stage1/behavior/type_info.zig index 12a7c118b7..3eb91d534f 100644 --- a/test/stage1/behavior/type_info.zig +++ b/test/stage1/behavior/type_info.zig @@ -299,3 +299,17 @@ test "type info: optional field unwrapping" { _ = field.offset orelse 0; } + +test "type info: pass to function" { + _ = passTypeInfo(@typeInfo(void)); + _ = comptime passTypeInfo(@typeInfo(void)); +} + +fn passTypeInfo(comptime info: TypeInfo) type { + return void; +} + +test "type info: TypeId -> TypeInfo impl cast" { + _ = passTypeInfo(TypeId.Void); + _ = comptime passTypeInfo(TypeId.Void); +}