From ffd1b8a605ede02946df2208f32a89cb001cbca0 Mon Sep 17 00:00:00 2001 From: danusha2345 Date: Wed, 30 Sep 2026 21:26:32 +0300 Subject: [PATCH] fix(resolution): keep library-method calls on untyped receivers off same-named project methods A member call on a receiver of unknown type reached the lone same-named method for an untyped `recv.m` (instance-method 0.7). Standard-library names collected such calls: on Play ~2,500 Scala `map`/`get`/`foreach` calls and ~1,100 Java test-map `put` calls landed on unrelated project methods, and Python `d.setdefault()` on a same-file class's method. The standard-library method lists that already demand receiver evidence for Rust, Go, Kotlin, C# and VB.NET gain Python, Scala and Java sets: such a call now needs the receiver's own name to name the candidate's type. `cls` joins `self`/`this`/`base` as a receiver that is the calling type itself. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 1 + __tests__/library-method-calls.test.ts | 119 +++++++++++++++++++++++++ src/resolution/name-matcher.ts | 68 ++++++++++++-- 3 files changed, 183 insertions(+), 5 deletions(-) create mode 100644 __tests__/library-method-calls.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a3a3cde4..a257d3d4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -118,6 +118,7 @@ and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - In JavaScript and TypeScript, a default import now links to what the module's `export default` statement exports, wherever the statement sits in the file. Before, a module that declares its default, like `export default function Vans() {…}` or `export default class Store {…}`, had its default import linked to the first function it exports instead: in a React Router data-router app, where a page exports its `loader` or `action` above the page component, `import Vans, { loader as vansLoader } from './pages/Vans'` made the route `/vans` and every use of `Vans` lead to the loader. A component file that also exports a styled or memoized component no longer hands its default import to that component, and an anonymous default, like `export default function () {…}` or `export default () => …`, is no longer linked to a function exported beside it or nested inside it. A module loaded with `require('./x').default` is read the same way. Re-index JavaScript and TypeScript projects after upgrading. - In React and Vue, a tag for a component the file imports from a package, like `