Skip to content

fix(scala): emit heritage edges for qualified extends/with clauses - #1794

Open
Synvoya wants to merge 1 commit into
Graphify-Labs:v8from
Synvoya:fix/scala-qualified-extends
Open

fix(scala): emit heritage edges for qualified extends/with clauses#1794
Synvoya wants to merge 1 commit into
Graphify-Labs:v8from
Synvoya:fix/scala-qualified-extends

Conversation

@Synvoya

@Synvoya Synvoya commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Bug

Scala qualified parents were either dropped or retained as package-qualified labels. For example, class Foo extends pkg.Base with other.Trait should emit Foo -> Base and Foo -> Trait.

Root cause

The heritage walker handled type_identifier and a narrow generic_type shape. Qualified parents parse as stable_type_identifier; qualified generic parents wrap that node inside generic_type.

Fix

Normalize heritage nodes through one bounded helper:

  • plain type_identifier returns its name;
  • stable_type_identifier returns its final type segment;
  • generic_type recursively normalizes its base type.

Only direct heritage children are considered, so package segments, generic arguments and constructor arguments cannot become parent edges. The first parent remains inherits; subsequent with parents remain mixes_in.

Validation

  • Covers simple qualified parents.
  • Covers qualified generic parents.
  • Covers multi-segment packages and constructor arguments.
  • Verifies package qualifiers and generic arguments are not emitted as parents.
  • tests/test_languages.py: 319 passed, 13 optional-DM skips.
  • Ruff and git diff --check: passed.

@Synvoya

Synvoya commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up audit against current v8 found that qualified generic parents such as pkg.Base[Int] still retained the package prefix through the generic_type path. The branch now normalizes both plain and generic qualified parents to the tail type name and extends the regression test. Current validation: tests/test_languages.py 319 passed, 13 skipped; Ruff and git diff --check passed.

@Synvoya
Synvoya force-pushed the fix/scala-qualified-extends branch from 7fd68d9 to 8949e4f Compare July 27, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant