Skip to content

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Oct 22, 2019

  • Add a new locator path element "condition" to represent condition expression of if expression and ternary operator.
  • While generating constraints switch to use if as a anchor for conditional expression conversion to Bool.
  • Use contextual mismatch diagnostics we already have for while, guard etc. to diagnose if/ternary conditional mismatches.

Resolves: rdar://problem/56559847

xedin added 3 commits October 22, 2019 15:00
"Condition" path element is used to represent a condition expression
associated with `if` expression or ternary operator `? :`.

Locator has been changed in the way that it's now anchored from `if`
itself which simplifies down to condition expression it needed.
@xedin xedin requested a review from hborla October 22, 2019 22:38
@xedin
Copy link
Contributor Author

xedin commented Oct 22, 2019

This and #27834 get us almost to the point where we can remove all of Constraint * related logic from CSDiag. There are a couple of ambiguities I need to investigate still.

@xedin
Copy link
Contributor Author

xedin commented Oct 22, 2019

@swift-ci please smoke test

@xedin xedin merged commit fb6ce64 into swiftlang:master Oct 23, 2019
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