Read already-processed expression types from ExpressionResults in NodeScopeResolver - #6139
Merged
Merged
Conversation
…eScopeResolver Straightforward conversions where the read targets an expression whose result is in hand: the for-loop last-condition truthiness, the const/class-const declaration values (the scope is exactly the value result's before-scope), and the foreach loop-value narrowing read directly by variable name (an assigned variable, not a processed expression). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019wqGgaD7iqL44t1KgpJS7b
ondrejmirtes
force-pushed
the
expression-result-type-reads-5
branch
from
July 28, 2026 17:43
7b7e100 to
0d5ba03
Compare
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.
Fifth batch of the ExpressionResult-read conversions (independent PR on 2.2.x) — reworked per feedback to straightforward reads only; the
Closure::call/clone-with Noop-preprocessing pieces are dropped.for-loop last-condition truthiness reads the condition result.constand class-const declaration values read their results (the assigning scope is exactly the value result's before-scope).getVariableType()) — it is an assigned variable, not a processed expression.Inspected and left with the sweep: the match-arm condition read (it prices a synthetic
Identical), the assign-value reorder (regresses bug-13623 without the coalesce isset-descriptor machinery), and the first-class-callable handler consolidation.Observation for a separate look, not touched here: in the foreach rewrite,
$keyLoopNativeTypes[]is filled viagetType($keyVarExpr)— same as the phpdoc list — wheregetNativeTypelooks intended.Validation: full test suite green (17776 tests), self-analysis clean, code style clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_019wqGgaD7iqL44t1KgpJS7b