Skip to content

[Type checker] Clean up expression type checking flags #29589

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 6 commits into from
Feb 1, 2020

Conversation

DougGregor
Copy link
Member

The TypeCheckExprFlags enum has amassed a few flags that are either redundant (because they can be computed from other information) or simply unused. Remove them.

This flag is recoverable from the contextual type purpose; don’t duplicate
the logic.
This is always set along with SubExpressionDiagnostics, so use that
for both purposes. That flag will go away when `CSDiag.cpp` goes away.
A contextual type purpose, that is, so it captures more about what the
entity is that is being solved.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@@ -641,7 +641,7 @@ bool GenericArgumentsMismatchFailure::diagnoseAsError() {
switch (last.getKind()) {
case ConstraintLocator::ContextualType: {
auto purpose = getContextualTypePurpose();
assert(!(purpose == CTP_Unused && purpose == CTP_CannotFail));
assert(!(purpose == CTP_Unused || purpose == CTP_CannotFail));
Copy link
Contributor

Choose a reason for hiding this comment

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

Oops...

@swift-ci swift-ci merged commit b6d9dcc into swiftlang:master Feb 1, 2020
@DougGregor DougGregor deleted the expr-type-check-flag-cleanups branch February 1, 2020 14:51
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