Skip to content

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

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 1 commit into from
Jul 3, 2020

Conversation

hamishknight
Copy link
Contributor

@hamishknight hamishknight commented Jul 2, 2020

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 xedin July 2, 2020 04:08
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
Copy link
Contributor Author

Talked with Pavel offline, and decided that we should just remove the right-hand side type variable check entirely, as the constraint system should be responsible for applying any additional conditions.

@hamishknight hamishknight force-pushed the one-time-activation branch from 29f071c to 23e7974 Compare July 2, 2020 20:19
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please test source compatibility

@hamishknight hamishknight changed the title [CS] Use correct type var for one-way constraint reactivation [CS] Avoid checking RHS of one-way constraint for reactivation Jul 2, 2020
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.

LGTM!

@hamishknight hamishknight merged commit 75a24ca into swiftlang:master Jul 3, 2020
@hamishknight hamishknight deleted the one-time-activation branch July 3, 2020 01:16
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