mirror of
https://github.com/safishamsi/graphify.git
synced 2026-10-20 10:51:24 +00:00
A `struct Stack<Element>` / `func map<R>(...)` binds `Element`/`R` as local names, not corpus symbols, but `_swift_collect_type_refs` appended the bare identifiers used in a signature or stored-property type as type references and ran them through the sourceless-stub path. Every generic type/function in the corpus then collapsed its `T` onto one bare `t` node — a god node that pollutes god-node rankings, since single-letter type parameters are not in the analyzer's builtin-noise filter. C#, Java, TypeScript, Kotlin, Scala, C++, and Go already exclude theirs. Mirrors that pattern (and complements the `Self` keyword fix already in this collector): a new `_swift_type_parameters_in_scope` helper walks up to every enclosing declaration's `type_parameters` list and takes each `type_parameter`'s first `type_identifier` as the bound name (a constraint like `T: Equatable` is a separate `user_type`, left to reference), and `_swift_collect_type_refs` auto-computes and threads that skip set. Genuine user types and the `Int`/ `String` builtin hubs are unaffected.