wcc/check: #14 nominal typeeqast (aliassym) closes A6 cross-module variant identity (wwstage)

typeeqast's N_TNAME arm compared variant types by SURFACE string
(streq(aa.str, bb.str)), so a cross-module type referenced bare
(oserror) vs qualified (os.oserror) mis-compared unequal -> A6:
concrete->tagged silently mis-identified the variant. Resolve each
name to its canonical type sym before comparing: keep the streq
fast-path, else aliassym(c,aa)==aliassym(c,bb) (ww's existing resolver
maps bare [#53] and qualified [#51] to the same SK_TYPE sym). AST
analog of cstage type.c:278 TY_NAMED a==b / harec types.c:579
ident_equal -- NO interning. `c` threaded into 21 typeeqast sites.
B-full Layer 1: closes A6/#14; Layer 2 (A7 tagged->tagged subset
reject) stays deferred to the #199b flatten arc. Byte-id-neutral;
graduates shlex #59.15 (989 M_WWREJECT->M_ID). test/wcc/839 pins
both-stage symmetry (discriminating teeth = 989 #59.15, per 839 doc).
This commit is contained in:
2026-06-09 21:27:40 +09:00
parent 5c28c90837
commit 758d3ec8c3
6 changed files with 395 additions and 76 deletions

View File

@@ -263,6 +263,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_tagged_assignable_cluster \
$(BIN)/test_idcast_tagged_return \
$(BIN)/test_global_tagged_castinit \
$(BIN)/test_xmod_nominal_typeeqast \
$(BIN)/test_inferred_array_global \
$(BIN)/test_slice_str_global_arg \
$(BIN)/test_slice_str_global_zero \
@@ -758,6 +759,12 @@ $(BIN)/test_global_tagged_castinit: test/wcc/838_global_tagged_castinit.c $(BIN)
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
$(BIN)/test_xmod_nominal_typeeqast: test/wcc/839_xmod_nominal_typeeqast.c $(BIN)/ww \
$(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \
$(BIN)/ww_ww $(BIN)/w6c_ww $(BIN)/w6a_ww $(BIN)/w6l_ww \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
$(BIN)/test_inferred_array_global: test/wcc/833_inferred_array_global.c $(BIN)/ww \
$(BIN)/w6c $(BIN)/w6a $(BIN)/w6l \
$(BIN)/ww_ww $(BIN)/w6c_ww $(BIN)/w6a_ww $(BIN)/w6l_ww \