Repository navigation
Conversation
colbymchenry#2466) Dart privacy is per library, but isVisibleAcrossFiles treated a Dart _name as file-local, so calls between a library file and its part files were dropped. Check private Dart candidates with inSameDartLibrary first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WuRWooMLGXysyySZsUMNVH
maxmilian
force-pushed
the
fix/dart-part-private-2466
branch
from
October 23, 2026 01:57
c19935e to
5d4b1d5
Compare
Owner
|
Thanks for this fix, @maxmilian! The same fix landed on main in #2832, which used your PR as its guide and credits you; it also covers part files when there's no pubspec. Your test passes on current main. Closing as already fixed; it ships in the next release after 1.6.2. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2466.
Changes
isVisibleAcrossFiles(src/resolution/name-matcher.ts): a Dartprivatecandidate is now checked with the existinginSameDartLibrary(the library file plus itspartfiles) before thePRIVATE_IS_FILE_LOCALrule. Dart privacy is per library, so calls between a library and its parts link again. A private member of another library stays unlinked.inSameDartLibraryreturns false when the library is unknown, so that case behaves as before.__tests__/dart-part-directives.test.ts: the four-file repro from the issue (library file, two parts, one part in a subdirectory) plus a file in another library that calls the greeter's_trace.[Unreleased].Verification
callsedges onmain(only the same-file control), 5 of 5 with the fix, and the other library's call stays unlinked.npx tsc --noEmitclean.npm test(Node 22): 6442 passed, 1 failed. The failure wasui-server-api.test.ts› "caps the caller list … and stays fast", a timing assertion under full-suite load; it passes on its own (62/62, twice).🤖 Generated with Claude Code
https://claude.ai/code/session_01WuRWooMLGXysyySZsUMNVH