Commit 357813b193

Jimmi Holst Christensen <jhc@liab.dk>
2019-03-08 13:42:55
added tests
1 parent 2d7f0ca
Changed files (1)
test
stage1
behavior
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);
+}