Run the impossible-check and nullsafe rules on post-processing virtual nodes - #6157
Merged
Conversation
…l nodes Ported from the resolve-type-rewrite-2 branch. The impossible-check rules listened on the raw call nodes and the nullsafe rules on the raw nullsafe nodes - both firing while the expression was still being processed, asking the scope to specify types or read receiver types before the node itself was done. NodeScopeResolver now emits FunctionCallExpressionNode / MethodCallExpressionNode / StaticMethodCallExpressionNode after the call is processed and stored, and the nullsafe handlers emit NullsafeMethodCallExpressionNode / NullsafePropertyFetchExpressionNode carrying the receiver's entry-scope type, so the rules run on the fully processed expression. The rule-facing nodes extend NodeAbstract, following f935366. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7
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.
Ported from the resolve-type-rewrite-2 branch. The impossible-check rules listened on the raw
FuncCall/MethodCall/StaticCalland the nullsafe rules on the raw nullsafe nodes — both firing while the expression was still being processed, asking the scope to specify types (or read receiver types) before the node itself was done. NodeScopeResolver now emitsFunctionCallExpressionNode/MethodCallExpressionNode/StaticMethodCallExpressionNoderight after the call is processed and stored, and the nullsafe handlers emitNullsafeMethodCallExpressionNode/NullsafePropertyFetchExpressionNodecarrying the receiver's entry-scope type — the rules run on the fully processed expression and stop re-asking the scope.The five nodes extend
NodeAbstractper f935366 (rule-facing virtual nodes must not reachgetType()). On this branch they carry only what the 2.2.x rules read; the rewrite branch's versions additionally carry the call'sExpressionResult— that stays branch-side until the sweep.Zero analysis-output churn: full test suite (twice — before and after slimming the nodes), all five rules' test suites,
make phpstanandmake csgreen.🤖 Generated with Claude Code
https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7