Skip to content

Kotlin typealias declarations dropped, so in-file references mint a sourceless god node #4553

Closed

Description

@rajatnagda45

Version

v8 @ 0.9.92 (86c57be)

Problem

A Kotlin typealias is a named type, but type_alias is in neither class_types nor function_types, so the declaration is dropped. A property or parameter typed as the alias still resolves the name through ensure_named_node, which mints a sourceless stub and points the references edge at it — even though the alias is declared in the same file.

That violates the provenance invariant (a real source-backed declaration losing to a sourceless god node; the bare-id stub becomes a cross-file hub). Scala and TypeScript already model type aliases as nodes, so Kotlin is the inconsistent outlier.

Reproduce

typealias ClickHandler = (Int) -> Unit
class Button {
    var onClick: ClickHandler? = null
    fun handler(h: ClickHandler) { onClick = h }
}

ClickHandler appears as a node with empty source_file; Button/handler reference that sourceless node.

Expected vs actual

  • Expected: ClickHandler is a sourced node in the declaring file; references bind to it.
  • Actual: ClickHandler is sourceless; references bind to the stub.

Notes

type_alias has an identifier name (covered by name_fallback_child_types) and no body, so it emits a clean empty type node (no phantom members).

Activity

  1. github-actions commented on Oct 18, 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 20, 2026

    @safishamsi
    Member

    Fixed in 0.9.93 by #4557. A Kotlin typealias reference no longer mints a sourceless stub. Thanks @rajatnagda45 for the report. Live on PyPI: https://pypi.org/project/graphifyy/0.9.93/

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