Skip to content

[Type checker] Eliminate some unnecessary ExprTypeCheckListener subclasses #29588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 1, 2020

Conversation

DougGregor
Copy link
Member

As part of eliminating ExprTypeCheckListener so the logic for type-checking expressions is encapsulated within the solver, eliminate two of the remaining four ExprTypeCheckListener subclasses:

  • Type checking an expression pattern no longer needs special code, because typeCheckCondition does all we need
  • Type checking an @autoclosure default parameter can have its logic sunk into the constraint system

Type checking an expression pattern had a hack to work around some diagnostics
issues with conditions. These issues have been addressed by the new
diagnostic infrastructure, so remove this unnecessary use of
ExprTypeCheckListener and check the expression pattern condition using…
typeCheckCondition().
…e solver

Rather than use an ExprTypeCheckListener subclass to introduce the
autoclosure expression, do it at the end of solving.
@DougGregor DougGregor requested a review from xedin February 1, 2020 02:23
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit 8c8f5b1 into swiftlang:master Feb 1, 2020
@DougGregor DougGregor deleted the silence-the-listeners branch February 1, 2020 04:38
Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

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.

3 participants