You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Go AST extractor emits phantom duplicate nodes for cross-file type references #1500
A Go type defined once but referenced via parameter/return/field types in N other
files produces 1+N nodes — the extras carry the referencing file's path
(extension and all) baked into the id (pkg_a_go_thing). This is the same
phantom-duplicate class #1402 handled for the other extractors; the Go copy of ensure_named_node still uses the older sourced-stub fallback, so its cross-file
references don't get picked up by _rewire_unique_stub_nodes.
Surfaced while running graphify over two production Go codebases — sql.NullTime
referenced across files showed up as 15 separate nodes and PublicKey as 33.
Make the Go ensure_named_node cross-file fallback emit a sourceless stub like the
other extractors, so the references resolve to the single canonical definition. With
that the repro yields one pkg_thing, and across the two corpora the phantom
type-ref nodes drop from 116→7 and 158→7 — the residual being external types
(sql.NullTime, no local definition) and same-named types defined in two packages,
which the other extractors leave alone by design.
Fixed on v8 (36b76ce, PR #1501, thanks @TPAteeq) — Go cross-file type references now emit sourceless stubs, so a type defined once and referenced from N files resolves to a single node instead of N phantom duplicates. Ships in the next release.
Activity
fix(extract): Go cross-file type refs emit sourceless stubs (#1500)
fix(extract): disambiguate imported type stubs across files without b…
safishamsi commentedon Jun 27, 2026
Fixed on
v8(36b76ce, PR #1501, thanks @TPAteeq) — Go cross-file type references now emit sourceless stubs, so a type defined once and referenced from N files resolves to a single node instead of N phantom duplicates. Ships in the next release.release: 0.8.51
fix(extract): Go cross-file type refs emit sourceless stubs (Graphify…
fix(extract): disambiguate imported type stubs across files without b…
release: 0.8.51