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:
agra
2026-06-07 22:17:07 +03:00
parent a8c7404a2f
commit 4b2a067991
3 changed files with 292 additions and 74 deletions

View File

@@ -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).?);
}