Commit Graph
8 Commits
Author SHA1 Message Date
ctype_lab e2195940fb fix(union): complete downstream container handling 2026-08-06 17:50:25 +09:00
ctype_lab e922563e05 fix(resolution): recognize union instantiation 2026-08-06 17:11:26 +09:00
ctype_lab ba58365c6f docs(union): describe first-class union nodes 2026-08-06 17:11:26 +09:00
ctype_lab 8e3cde6994 feat(kernel): preserve union nodes across extraction 2026-08-06 17:11:26 +09:00
ctype_lab 6978acc92e feat(extraction): model union declarations distinctly 2026-08-06 17:10:52 +09:00
ctype_labandClaude Opus 5 86854cd0d7 docs(union): changelog entry + port-checklist annotations
The two kernel port checklists record the extractor configs as surveyed
at porting time; their structTypes lines are marked superseded rather
than rewritten, so the surveys stay readable as history.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 15:47:09 +09:00
ctype_labandClaude Opus 5 11acc504b5 test(union): regression cases + kernel-parity torture coverage
Four cases in extraction.test.ts: a Rust union carrying an
`impl Trait for` edge and owning the impl's method; a named C union
alongside a forward declaration that must NOT mint a node; a
`typedef union` taking the typedef name with no `<anonymous>` twin; a
C++ union with a member function.

Verified they fail without the fix on BOTH extraction paths — the wasm
walker via CODEGRAPH_KERNEL=0 and the kernel with a staged build.

torture.c / torture.rs gain the same shapes. The parity gate compares
the two walkers rather than a snapshot, so the fixtures do not detect
the bug on their own — they pin that the fix stays SYMMETRIC. The
regression tests above are what pin that it is present.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 15:47:09 +09:00
ctype_labandClaude Opus 5 85e9ac6762 fix(c,cpp,objc,rust): index union declarations
A `union` declaration produced no symbol at all in any of the four
languages that have one. The type never entered the graph, and neither
did anything attached to it — in Rust every `impl Trait for MyUnion`
lost its edge, and the impl's methods were left with a qualifiedName
pointing at a type the graph did not contain.

`union_specifier` / `union_item` were absent from the extraction layer
entirely: no `<x>Types` list on the TS side, no dispatch branch in
either kernel walker.

They join `structTypes` (kind `struct` — NodeKind has no `union`), which
is the extension point the table-driven extractors already provide. The
body guard in extractStruct is untouched, so a bodiless `union U;` stays
a forward declaration and is still skipped, exactly like `struct U;`.

`resolveTypeAliasKind` accepts `union_specifier` too, so
`typedef union { … } N;` takes the typedef's name the way
`typedef struct { … } N;` already did. Without it the anonymous union
body would mint a second `<anonymous>` node beside the alias.

Both walkers change together so kernel<->wasm parity holds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 15:46:53 +09:00