Resolve early-terminating calls to an explicit never type in the call handlers - #6134
Merged
Merged
Conversation
… handlers A MethodCall/StaticCall/FuncCall configured via earlyTerminatingMethodCalls/earlyTerminatingFunctionCalls now resolves to an explicit NeverType in its handler, through a shared EarlyTerminatingCallHelper. findEarlyTerminatingExpr()'s duplicate list-matching goes away - its existing explicit-never check covers the configured calls the same way it already covers exit/die/throw and signature-never calls - and the lists move off NodeScopeResolver's constructor onto the helper as DI parameters. The test-case overrides are replaced by a nodeScopeResolverEarlyTerminating.neon parameter file. 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.
Extracted from the
resolve-type-rewrite-2branch (adapted to the resolveType world; follows the #6125–#6133 series).Calls configured as
earlyTerminatingMethodCalls/earlyTerminatingFunctionCallsnow resolve to an explicitNeverTypeinFuncCallHandler/MethodCallHandler/StaticCallHandler, via a sharedEarlyTerminatingCallHelper(#[AutowiredService], fed the parameters directly).NodeScopeResolver::findEarlyTerminatingExpr()drops its duplicate list-matching — its existing explicit-never check now covers configured calls exactly likeexit/die/throwand signature-nevercalls — and the two lists leaveNodeScopeResolver's constructor.TypeInferenceTestCase::getEarlyTerminatingMethodCalls()/getEarlyTerminatingFunctionCalls()overrides are replaced by an additional config file (nodeScopeResolverEarlyTerminating.neon), matching how the branch migrates them.Net effect: configured calls now genuinely type as
never(visible to rules and inference), instead of being special-cased only for exit-point detection.Validation: full test suite green (17776 tests), self-analysis clean, code style clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_019wqGgaD7iqL44t1KgpJS7b