Derive the type-check verdict in FuncCallHandler - #6221
Merged
Conversation
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
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.
Replaces #6219 (rejected direction) — extracted from the resolve-type-rewrite branch, where the same move just landed.
TypeSpecifyingFunctionsDynamicReturnTypeExtensionexisted only to pinarray_key_exists()/key_exists()/in_array()/is_subclass_of()calls toConstantBooleanTypewhen the check is decided — and it needed theTypeSpecifierAwareExtensionsetter dance purely to constructImpossibleCheckTypeHelper. The verdict now lives at the same decision point insideFuncCallHandler'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 byTypeSpecifierFactory::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 itsTypeSpecifier, 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