Skip to content

Pin the iteratee's entry types in the by-ref foreach intertwined expression - #6217

Merged
ondrejmirtes merged 1 commit into
2.2.xfrom
enterforeach-iteratee-pinning
Aug 13, 2026
Merged

ondrejmirtes merged 1 commit into
2.2.xfrom
enterforeach-iteratee-pinning

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

Extracted from the resolve-type-rewrite branch. The SetExistingOffsetValueTypeExpr subject inside the by-ref foreach IntertwinedVariableByReferenceWithExpr re-priced the raw iteratee through Scope::getType() on every ask of the intertwined node. The iteratee's phpdoc and native types at loop entry are already threaded into enterForeach() (#6162), and the sibling key expression already pins them the same way.

The outer IntertwinedVariableByReferenceWithExpr keeps carrying the raw iteratee, so invalidation on reassignment is unchanged. Both test suites pass with zero expectation churn.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7

…ession

The SetExistingOffsetValueTypeExpr subject re-priced the raw iteratee
through Scope::getType() on every ask of the intertwined node. The
iteratee's phpdoc and native types at loop entry are already threaded
into enterForeach(), and the sibling key expression already pins them
the same way; the outer IntertwinedVariableByReferenceWithExpr keeps
carrying the raw iteratee, so invalidation on reassignment is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7
@ondrejmirtes
ondrejmirtes merged commit 90514d9 into 2.2.x Aug 13, 2026
311 of 312 checks passed
@ondrejmirtes
ondrejmirtes deleted the enterforeach-iteratee-pinning branch August 13, 2026 09:11
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