Read operand types from ExpressionResults in Ternary/ArrayDimFetch/PropertyFetch handlers - #6136
Merged
Merged
Conversation
…opertyFetch handlers Where the handler already holds the child's ExpressionResult, read the type off the result instead of re-asking a scope: the ternary condition (the entry scope is exactly the condition result's before-scope), the two ternary branch explicit-never checks, the property-hook holder type (scopeBeforeVar is exactly the var result's before-scope) and the array dim fetch var type. Second batch of converting handler Scope::getType() reads to ExpressionResult reads. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019wqGgaD7iqL44t1KgpJS7b
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.
Second batch of converting handler
$scope->getType()reads toExpressionResultreads (follows the first batch merged in346dfbba83; independent PR based on 2.2.x).Five sites where the handler already holds the child's result:
TernaryHandler: the condition type (the entry scope is exactly the condition result's before-scope — an exact equivalence) and the two branch explicit-never checks.PropertyFetchHandler: the property-hook holder type ($scopeBeforeVaris exactly the var result's before-scope — exact equivalence).ArrayDimFetchHandler: the var type feeding theArrayAccesscheck andoffsetGetthrow-point synthesis.On 2.2.x these resolve from the stored before-scope, keeping behavior identical (full suite green); on the
resolve-type-rewrite-2branch the same call sites are answered from the result's computed type without a scope walk. The branch's offset-virtual-handler batch was inspected and skipped — it is inseparable from the callback world.Validation: full test suite green (17776 tests), self-analysis clean, code style clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_019wqGgaD7iqL44t1KgpJS7b