Decouple ImpossibleCheckTypeHelper from TypeSpecifier - #6219
Closed
ondrejmirtes wants to merge 1 commit into
Closed
Conversation
The helper asked its injected TypeSpecifier to specify types in the checked call's condition; the new internal MutatingScope::specifyTypesOfNewWorldHandlerNode() asks the scope instead, so the helper no longer needs the dependency and TypeSpecifyingFunctionsDynamicReturnTypeExtension no longer needs the TypeSpecifierAwareExtension setter dance to construct it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7
Member
Author
|
Superseded by #6221 — the verdict moves into FuncCallHandler and the extension is deleted; no Scope-surface specify method. |
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 branch (its TypeSpecifier↔extension decoupling, re-expressed for 2.2.x).
ImpossibleCheckTypeHelperheld an injectedTypeSpecifieronly to ask it to specify types in the checked call's condition — andTypeSpecifyingFunctionsDynamicReturnTypeExtensionhad to implementTypeSpecifierAwareExtension(the setter dance) purely to construct the helper. The new@internalMutatingScope::specifyTypesOfNewWorldHandlerNode()asks the scope for the narrowing instead — on 2.2.x it is a thin wrapper over the scope's ownTypeSpecifier; the name matches the rewrite branch's counterpart (there it reads the narrowing from the node's already-computed ExpressionResult) so the helper converges at the eventual merge.ImpossibleCheckTypeHelperloses theTypeSpecifierconstructor dependency (DI callers unaffected; the 16 rule-test construction sites drop the argument)TypeSpecifyingFunctionsDynamicReturnTypeExtensionno longer implementsTypeSpecifierAwareExtensionBoth test suites pass in both turbo modes (21319 tests), self-analysis clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7