This PR fixes the bug demonstrated in #5369. As of this PR, name resolution (logically) works as follows:
When resolving a name foo,
Start with all names in scope (the project local definitions, direct dependencies, and indirect dependencies)
Throw away names that don't end in foo
Throw away indirect dependencies, unless they're all indirect dependencies
This implements the "prefer direct deps to indirect deps" logic
(for terms only) Throw away names that don't typecheck (i.e. do TDNR)
Previously, the last step did not properly shadow namespace names with file names, and furthermore was a little out of sync with the "prefer direct deps" rule.
Test coverage
I've added a regression test for #5369, and another big transcript that shows how TDNR works in a number of different situations
Overview
Fixes #5369
This PR fixes the bug demonstrated in #5369. As of this PR, name resolution (logically) works as follows:
foo
,foo
Previously, the last step did not properly shadow namespace names with file names, and furthermore was a little out of sync with the "prefer direct deps" rule.
Test coverage
I've added a regression test for #5369, and another big transcript that shows how TDNR works in a number of different situations