You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Resolver: a bare call resolves 'unique' to a sub in an unrelated package/repository (package-scoped languages) #3443
Follow-up to #3401, found while fixing its Perl map case.
Problem
_ladder goes file → import → unique → nearest. For a bare call with no import edge, a name defined exactly once anywhere in the link group resolves unique, which is confident, so it becomes a file-graph edge. That's right for global-namespace languages: a C function, a Lua global, a PHP function. It's wrong for package-scoped languages, where a bare call can only reach the caller's own package or something it imports or exports. Perl subs are package-scoped, and the same holds for Python modules and JS/TS modules.
Measured on language-crucible (a Perl-only scan, after the #3401 built-in fix): bugzilla and spamassassin still resolve bare remove( (×2) and all( (×1) as unique into Mojo (mojo/…), a different repository they never use.
The crucible, with many repositories under one root, exaggerates this. A monorepo with independent packages has the same shape, though.
Proposal
For a bare call in a package-scoped language, unique should require that the definition is visible to the caller: same file, an imported file, or (for directory-namespaced languages, as _visible_receiver already does) the same directory. Otherwise it should be ambiguous, with the definition kept as the guess. Measure the golden-master and call_resolution_rates.py movement per language before choosing the set of languages. Python and JS/TS are likely the big movers.
Also noted
#3401's Swift row (alamofire/Response.swift, Popularity Rank 4 → 5) didn't reproduce as a map edge. Response.swift's map has parent_class_name DataResponse/DownloadResponse, so a bare call can't reach it; a call inside an extension of that type reaches it through class (implicit self), which is correct. Response.swift's golden-master popularity (5) differs from a Swift-only scan (1). The extra edges come from the whole-crucible scan and weren't attributed while fixing #3401.
Activity
Resolver: a bare Perl call to a built-in is the built-in (#3401) (#3444)
Re-bless golden masters for #3443's `unseen` step
test_function_graph: fixture moves to PHP, which keeps an unimported …
Call resolver: bare calls in package-scoped languages only resolve `u…