Skip to content

Swift: generic type parameters (<T>) leak as a sourceless god node t #4405

Closed

Description

@rajatnagda45

Version/commit: v0.9.88 (v8 @ a9860f7)
Environment: macOS, Python 3.13, uv sync --all-extras

Problem

_swift_collect_type_refs appends the bare generic parameter names (Element/R/T) used in a signature or stored-property type as type references and runs them through the sourceless-stub path. Every generic type/function in the corpus then collapses its parameter onto one bare node — a god node that pollutes god-node rankings (single-letter type params are not in the analyzer's builtin-noise filter). This complements the Self keyword fix already in this collector (#4382); C#, Java, TypeScript, Kotlin, and Go already exclude their type parameters.

Reproduction

struct Stack<Element> {
    var items: [Element]
    func map<R>(_ f: (Element) -> R) -> [R] { return [] }
}

Expected

Element/R dropped; genuine user types and the Int/String builtin hubs unaffected.

Actual

Sourceless nodes element/r with references edges.

Fix PR to follow.

Activity

  1. github-actions commented on Oct 13, 2026

    @github-actions

    Thanks for opening this issue, @rajatnagda45. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

  2. safishamsi commented on Oct 13, 2026

    @safishamsi
    Member

    Fixed in v0.9.89 (graphifyy 0.9.89 on PyPI) via #4409.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions