Conversation
Union and intersection receivers previously lost members declared past the first constituent because resolveMember indexed [0] on the receiver type's resolvable classes. It now iterates every class and returns the first find, mirroring SymbolResolver::getAccessibleMembers. MemberAccessDetector's three [0] sites route through the same shared helper (ExpressionResolver::receiverClassNames) and combine per-constituent visibility, so a union receiver widens to the most restrictive access across its members. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #485 +/- ##
=========================================
Coverage 99.39% 99.39%
- Complexity 1857 1863 +6
=========================================
Files 133 133
Lines 4780 4783 +3
=========================================
+ Hits 4751 4754 +3
Misses 29 29 ☔ View full report in Codecov by Harness. |
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.
Step 27 of
docs/architecture/build-manifest.md.Done
src/Resolution/indexes[0]ongetResolvableClassNames()— verified bydisallowedMethodCallsinphpstan.neon(allowlist restricted toExpressionResolver::receiverClassNamesandSymbolResolver::getAccessibleMembers, plus the twoDomain/recursive-composition sites)\$x->onlyB()where\$x: A|Band onlyBdeclaresonlyBanswer the same way completion offers it —UnionReceiverParityTestUnionReceiverParityTestcovers Hover, Definition, SignatureHelp, Completion against theEntity|Personfixture where each constituent declares a distinct member; intersection agreement is exercised by the existingSymbolResolverTest::testGetMemberAccessContextForIntersectionParameterResolvesTypestep-27entries inphpstan-baseline.neonare deleted;composer phpstanis clean