Skip to content

Read already-processed expression types from ExpressionResults in NodeScopeResolver - #6139

Merged
ondrejmirtes merged 1 commit into
2.2.xfrom
expression-result-type-reads-5
Jul 28, 2026
Merged

Read already-processed expression types from ExpressionResults in NodeScopeResolver#6139
ondrejmirtes merged 1 commit into
2.2.xfrom
expression-result-type-reads-5

Conversation

@ondrejmirtes

@ondrejmirtes ondrejmirtes commented Jul 28, 2026

Copy link
Copy Markdown
Member

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.

  • The for-loop last-condition truthiness reads the condition result.
  • const and class-const declaration values read their results (the assigning scope is exactly the value result's before-scope).
  • The foreach loop-array-rewrite reads the narrowed value variable directly by name (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 via getType($keyVarExpr) — same as the phpdoc list — where getNativeType looks intended.

Validation: full test suite green (17776 tests), self-analysis clean, code style clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_019wqGgaD7iqL44t1KgpJS7b

…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
ondrejmirtes force-pushed the expression-result-type-reads-5 branch from 7b7e100 to 0d5ba03 Compare July 28, 2026 17:43
@ondrejmirtes ondrejmirtes changed the title Process call arguments as reads before consuming their types Read already-processed expression types from ExpressionResults in NodeScopeResolver Jul 28, 2026
@ondrejmirtes
ondrejmirtes merged commit 3eaf151 into 2.2.x Jul 28, 2026
120 of 121 checks passed
@ondrejmirtes
ondrejmirtes deleted the expression-result-type-reads-5 branch July 28, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant