mirror of
https://github.com/colbymchenry/codegraph.git
synced 2026-10-02 01:37:32 +08:00
* fix(scala): resolve extends/with to the trait, not its companion object The Scala trait + companion object idiom puts two same-named symbols in one file. Both were indexed as kind 'class', so an 'extends X' reference tied between the trait and its companion and the winner was arbitrary. When the companion won, every subtype was detached from the trait's inheritance chain, and impact analysis on a widely-used trait stopped at depth 1. - classify Scala object_definition as 'module' (a singleton value, not a type - 'extends' can never target it) - add 'module' to the classifyClassNode contract and handle it in the extractor dispatch - in name matching, bias extends/implements references toward actual type definitions and penalize 'module' candidates, so the trait wins the tie deterministically Regression test: trait + companion in one file, subclass in another - the extends edge must land on the trait and impact must reach the subtype through it. * fix(scala): resolve companion inheritance to type definitions (#1824) Scala objects and their companion types could tie during inheritance resolution, disconnecting subtype impact paths. Classify objects as modules in both extraction engines and reject Scala singleton inheritance targets across resolution strategies. Preserve object method lookup and inherited receiver methods, with declaration-order, impact, and native/WASM parity regressions. Co-authored-by: Hubert Tarnacki <hubert.tarnacki@comarch.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Hubert Tarnacki <hubert.tarnacki@comarch.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>