authorgravatar for jhc@dismail.deJimmi Holst Christensen <jhc@dismail.de> 2019-03-08 13:42:55+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-03-11 10:55:43-04:00
log357813b1930579af2ba3b5004131ac9f3f80ba57
tree955d7c91aee5db0035d4651aa1e9a78ca9afa7f3
parent2d7f0ca387898fa6fb7da7946e4ecff45058b99c
signature Commit is signed but in an unrecognized format.

added tests


1 files changed, 14 insertions(+), 0 deletions(-)

test/stage1/behavior/type_info.zig+14
......@@ -299,3 +299,17 @@ test "type info: optional field unwrapping" {
299299
300300 _ = field.offset orelse 0;
301301}
302
303test "type info: pass to function" {
304 _ = passTypeInfo(@typeInfo(void));
305 _ = comptime passTypeInfo(@typeInfo(void));
306}
307
308fn passTypeInfo(comptime info: TypeInfo) type {
309 return void;
310}
311
312test "type info: TypeId -> TypeInfo impl cast" {
313 _ = passTypeInfo(TypeId.Void);
314 _ = comptime passTypeInfo(TypeId.Void);
315}