| ... | ... | @@ -286,10 +286,6 @@ fn testStruct() !void { |
| 286 | 286 | try expect(struct_info.Struct.fields[3].alignment == 1); |
| 287 | 287 | try expect(struct_info.Struct.decls.len == 2); |
| 288 | 288 | try expect(struct_info.Struct.decls[0].is_pub); |
| 289 | | try expect(!struct_info.Struct.decls[0].data.Fn.is_extern); |
| 290 | | try expect(struct_info.Struct.decls[0].data.Fn.lib_name == null); |
| 291 | | try expect(struct_info.Struct.decls[0].data.Fn.return_type == void); |
| 292 | | try expect(struct_info.Struct.decls[0].data.Fn.fn_type == fn (*const TestStruct) void); |
| 293 | 289 | } |
| 294 | 290 | |
| 295 | 291 | const TestUnpackedStruct = struct { |
| ... | ... | @@ -420,34 +416,6 @@ test "type info: TypeId -> TypeInfo impl cast" { |
| 420 | 416 | _ = comptime passTypeInfo(TypeId.Void); |
| 421 | 417 | } |
| 422 | 418 | |
| 423 | | test "type info: extern fns with and without lib names" { |
| 424 | | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 425 | | |
| 426 | | const S = struct { |
| 427 | | extern fn bar1() void; |
| 428 | | extern "cool" fn bar2() void; |
| 429 | | }; |
| 430 | | const info = @typeInfo(S); |
| 431 | | comptime { |
| 432 | | for (info.Struct.decls) |decl| { |
| 433 | | if (std.mem.eql(u8, decl.name, "bar1")) { |
| 434 | | try expect(decl.data.Fn.lib_name == null); |
| 435 | | } else { |
| 436 | | try expectEqualStrings("cool", decl.data.Fn.lib_name.?); |
| 437 | | } |
| 438 | | } |
| 439 | | } |
| 440 | | } |
| 441 | | |
| 442 | | test "data field is a compile-time value" { |
| 443 | | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 444 | | |
| 445 | | const S = struct { |
| 446 | | const Bar = @as(isize, -1); |
| 447 | | }; |
| 448 | | comptime try expect(@typeInfo(S).Struct.decls[0].data.Var == isize); |
| 449 | | } |
| 450 | | |
| 451 | 419 | test "sentinel of opaque pointer type" { |
| 452 | 420 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 453 | 421 | |