Skip to content

Decouple ImpossibleCheckTypeHelper from TypeSpecifier - #6219

Closed
ondrejmirtes wants to merge 1 commit into
2.2.xfrom
decouple-impossible-check-type-helper
Closed

Decouple ImpossibleCheckTypeHelper from TypeSpecifier#6219
ondrejmirtes wants to merge 1 commit into
2.2.xfrom
decouple-impossible-check-type-helper

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

Extracted from the resolve-type-rewrite branch (its TypeSpecifier↔extension decoupling, re-expressed for 2.2.x).

ImpossibleCheckTypeHelper held an injected TypeSpecifier only to ask it to specify types in the checked call's condition — and TypeSpecifyingFunctionsDynamicReturnTypeExtension had to implement TypeSpecifierAwareExtension (the setter dance) purely to construct the helper. The new @internal MutatingScope::specifyTypesOfNewWorldHandlerNode() asks the scope for the narrowing instead — on 2.2.x it is a thin wrapper over the scope's own TypeSpecifier; 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.

  • ImpossibleCheckTypeHelper loses the TypeSpecifier constructor dependency (DI callers unaffected; the 16 rule-test construction sites drop the argument)
  • TypeSpecifyingFunctionsDynamicReturnTypeExtension no longer implements TypeSpecifierAwareExtension

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

🤖 Generated with Claude Code

https://claude.ai/code/session_01DaBZjgksga4c5s6Q9FniY7

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
@ondrejmirtes

Copy link
Copy Markdown
Member Author

Superseded by #6221 — the verdict moves into FuncCallHandler and the extension is deleted; no Scope-surface specify method.

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