wip(E2): partial nominal-identity/shadow work [stdlib E2 attempt-1 WIP checkpoint]
Incomplete WIP from a worker killed at the 30-min wall; committed as a checkpoint so the resumed session continues on a clean tree. May not build.
This commit is contained in:
@@ -474,13 +474,14 @@ test "phase D: findUniqueByName returns the sole match" {
|
||||
try std.testing.expectEqual(id, table.findUniqueByName(foo).?);
|
||||
}
|
||||
|
||||
test "phase D: type_decl_tids maps decl node to TypeId" {
|
||||
test "phase D: type_decl_tids maps decl pointer to TypeId" {
|
||||
const alloc = std.testing.allocator;
|
||||
var table = TypeTable.init(alloc);
|
||||
defer table.deinit();
|
||||
|
||||
const id = table.internNominal(.{ .@"struct" = .{ .name = table.internString("Node1"), .fields = &.{} } }, 0);
|
||||
var node = ast.Node{ .span = .{ .start = 0, .end = 0 }, .data = .{ .int_literal = .{ .value = 0 } } };
|
||||
try table.type_decl_tids.put(&node, id);
|
||||
try std.testing.expectEqual(id, table.type_decl_tids.get(&node).?);
|
||||
const key: *const anyopaque = @ptrCast(&node);
|
||||
try table.type_decl_tids.put(key, id);
|
||||
try std.testing.expectEqual(id, table.type_decl_tids.get(key).?);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user