Skip to content

Conversation

DougGregor
Copy link
Member

Set the contextual type of conditional expressions (to Bool) with the
"condition" purpose so we get customized diagnostics for mistakes such
as

if x.property = y { }

Prior to this, we'd get generic "() isn't convertible to Bool"
diagnostic. Now we get

use of '=' in a boolean context, did you mean '=='?

We’ll want to pull these back out for diagnostic purposes.
Set the contextual type of conditional expressions (to Bool) with the
"condition" purpose so we get customized diagnostics for mistakes such
as

    if x.property = y { }

Prior to this, we'd get generic "() isn't convertible to Bool"
diagnostic. Now we get

    use of '=' in a boolean context, did you mean '=='?
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor requested a review from xedin January 24, 2020 18:19
@DougGregor DougGregor merged commit 8e5ae4c into swiftlang:master Jan 24, 2020
@DougGregor DougGregor deleted the contextual-conditions-for-function-builders branch January 24, 2020 20:41
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.

2 participants