Skip to content

Resolve early-terminating calls to an explicit never type in the call handlers - #6134

Merged
ondrejmirtes merged 1 commit into
2.2.xfrom
early-terminating-calls-in-handlers
Jul 28, 2026
Merged

Resolve early-terminating calls to an explicit never type in the call handlers#6134
ondrejmirtes merged 1 commit into
2.2.xfrom
early-terminating-calls-in-handlers

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

Extracted from the resolve-type-rewrite-2 branch (adapted to the resolveType world; follows the #6125#6133 series).

Calls configured as earlyTerminatingMethodCalls / earlyTerminatingFunctionCalls now resolve to an explicit NeverType in FuncCallHandler / MethodCallHandler / StaticCallHandler, via a shared EarlyTerminatingCallHelper (#[AutowiredService], fed the parameters directly). NodeScopeResolver::findEarlyTerminatingExpr() drops its duplicate list-matching — its existing explicit-never check now covers configured calls exactly like exit/die/throw and signature-never calls — and the two lists leave NodeScopeResolver'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

… 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
@ondrejmirtes
ondrejmirtes merged commit 2044bb0 into 2.2.x Jul 28, 2026
738 of 743 checks passed
@ondrejmirtes
ondrejmirtes deleted the early-terminating-calls-in-handlers branch July 28, 2026 17:00
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