1 Commits
Author SHA1 Message Date
Colby MchenryandClaude Opus 5.5 0c860c00b3 fix(dart): a bare call or type name reaches only what its library can see (#2386)
A receiver-less Dart call, constructor call or type name now links only to
a top-level declaration its library can see: one in the library itself (the
file and its parts) or one exported by a library it imports without a
prefix, through export chains and show/hide. A type written through an
import prefix (`p.Report`) means what that import exports. It is a
candidate filter ahead of the ranking in matchByExactName and matchFuzzy,
so a visible namesake wins, and a library's own declaration shadows an
imported one. The library model (pubspec packages, package: and relative
URIs, part / part of, conditional imports) is src/resolution/dart-libraries.ts.

A bare call also never reaches another type's enum constant or static
constant, a generic `extension<T> on X` counts as unnamed, and an unnamed
extension applies in every part of its library.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 16:27:05 +00:00