Skip to content

Derive the type-check verdict in FuncCallHandler - #6221

Merged
ondrejmirtes merged 1 commit into
2.2.xfrom
type-check-verdict-in-handler
Aug 13, 2026
Merged

Derive the type-check verdict in FuncCallHandler#6221
ondrejmirtes merged 1 commit into
2.2.xfrom
type-check-verdict-in-handler

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

Replaces #6219 (rejected direction) — extracted from the resolve-type-rewrite branch, where the same move just landed.

TypeSpecifyingFunctionsDynamicReturnTypeExtension existed only to pin array_key_exists()/key_exists()/in_array()/is_subclass_of() calls to ConstantBooleanType when the check is decided — and it needed the TypeSpecifierAwareExtension setter dance purely to construct ImpossibleCheckTypeHelper. The verdict now lives at the same decision point inside FuncCallHandler's dynamic-return-type resolution (the extension chain's fall-through, so other extensions keep precedence), with the helper constructor-injected — handlers are not materialized by TypeSpecifierFactory::create(), so there is no construction cycle and no aware dance. The extension is deleted; no new Scope API anywhere.

On the branch the verdict reads the call's own stored specifyTypesCallback; here the helper derives it through its TypeSpecifier, and the call site converges to the result-based form at the eventual merge.

Both test suites pass in both turbo modes (21323 tests), self-analysis clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7

TypeSpecifyingFunctionsDynamicReturnTypeExtension existed only to pin
array_key_exists()/key_exists()/in_array()/is_subclass_of() calls to
ConstantBooleanType when the check is decided - and it needed the
TypeSpecifierAwareExtension setter dance to construct
ImpossibleCheckTypeHelper. The verdict now lives at the same decision
point inside FuncCallHandler's dynamic-return-type resolution, with the
helper constructor-injected; the extension is deleted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7
@ondrejmirtes
ondrejmirtes merged commit 48e9de2 into 2.2.x Aug 13, 2026
754 of 756 checks passed
@ondrejmirtes
ondrejmirtes deleted the type-check-verdict-in-handler branch August 13, 2026 16:06
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