Skip to content

[5.3] [CS] Avoid checking RHS of one-way constraint for reactivation #32693

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

Conversation

hamishknight
Copy link
Contributor

@hamishknight hamishknight commented Jul 2, 2020

5.3 cherry-pick of #32673.


  • Explanation: Fixes a compiler crash that can potentially occur when using a function builder.

  • Scope: Fixes a 5.3 regression with function builders.

  • Radar: rdar://64890308

  • Risk: Medium-low: The fix modifies constraint re-activation, but is isolated to one-way constraints that haven't split the constraint system, and will cause us to re-activate strictly more constraints.

  • Testing: Added unit test.

  • Reviewer: @xedin

Previously we would only gather one-way constraints
if they were found through a type variable in their
right hand side. However we would incorrectly check
this against the type variable that we started the
search at. This meant that if the constraint was
found through a fixed binding, we would never
return it, and could therefore fail to re-activate
it, leaving it unsolved.

Fix this issue by simply removing the check for
the RHS, and letting the constraint system handle
it instead.

Resolves rdar://64890308.
@hamishknight hamishknight requested a review from a team as a code owner July 2, 2020 20:59
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please test source compatibility

@swiftlang swiftlang deleted a comment from swift-ci Jul 2, 2020
@hamishknight hamishknight merged commit 918f674 into swiftlang:release/5.3 Jul 3, 2020
@hamishknight hamishknight deleted the one-time-activation-5.3 branch July 3, 2020 03:00
@AnthonyLatsis AnthonyLatsis added swift 5.3 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants