From b2818198544f3417d73f0f2d1bb52022f2132efb Mon Sep 17 00:00:00 2001 From: Colby Mchenry Date: Thu, 1 Oct 2026 01:46:07 +0000 Subject: [PATCH] fix(resolution): a type never inherits from itself (#2229) An extends/implements ref that settled on the declaring type is re-chosen among the other types of its name, the one the written qualifier leads to (owner path plus file package), or none. Co-authored-by: Claude Opus 5.5 --- CHANGELOG.md | 1 + __tests__/supertype-not-self.test.ts | 73 ++++++++++++++++++++++++++++ src/resolution/name-matcher.ts | 30 ++++++++++++ 3 files changed, 104 insertions(+) create mode 100644 __tests__/supertype-not-self.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index ae2efec2d..eec3acb6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Fixes +- A type that extends another type of the same name now links to that other type instead of to itself. When the source spells out the qualifier, that qualifier picks between same-named candidates. Before, cats' `trait BigDecimalInstances extends cats.kernel.instances.BigDecimalInstances` and every `trait AllOps … with Functor.AllOps[…]` pointed back at the declaring trait, and Newtonsoft.Json's `JsonConverter : JsonConverter` extended itself. - In pytest tests, a parameter now takes the class its fixture returns, so a call on it reaches that class's method. If the class comes from a library, the call no longer reaches the project's only method of that name. Fixtures a `conftest.py` pulls in with `from … import *` or `pytest_plugins` now count as in reach. Before, flask's `runner.invoke(…)` on click's `CliRunner()` linked to the project's `FlaskCliRunner.invoke`, and `@app.get(…)` on a `Flask(…)` fixture linked to an unrelated `get`. - What a Svelte component's instance `