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