Skip to content

[4.2][ConstraintSystem] Fix a logic error in computing potential bindings. #17320

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 2 commits into from
Jun 19, 2018
Merged

Conversation

rudkx
Copy link
Contributor

@rudkx rudkx commented Jun 19, 2018

  • Explanation: In some cases we're failing to select potential type bindings for type variables due to a change that was made after 4.1 was released. The result is that we fail to type check code that worked before. The fix is a simple check of a condition that is missing in the code that computes potential bindings.
  • Scope: This could potentially hit any project.
  • Issue #: rdar://problem/40810000 / https://bugs.swift.org/browse/SR-7875
  • Risk: Very low.
  • Testing: Standard regression tests plus source compatibility tests.
  • Reviewer: @xedin

rudkx added 2 commits June 18, 2018 22:53
A change was made to attempt to use constraints that we have between
type variables to inform potential bindings, such that if we have:
   $T1 <: $T2
we would use $T1's bindings to add to the bindings of $T2. This is
only valid if we're adding bindings where $T1 is the supertype,
though, otherwise we could have the constraints:
  $T1 <: $T2
  $T1 <: X
imply that $T2 is a supertype of X, which doesn't make sense.

Fixes rdar://problem/40810000 (aka https://bugs.swift.org/browse/SR-7875).

(cherry picked from commit 54b2504)
@rudkx
Copy link
Contributor Author

rudkx commented Jun 19, 2018

@swift-ci Please test

@rudkx
Copy link
Contributor Author

rudkx commented Jun 19, 2018

@swift-ci nominate

@rudkx rudkx merged commit 7e9c8a3 into swiftlang:swift-4.2-branch-06-11-2018 Jun 19, 2018
@rudkx rudkx deleted the fix-sr7875-4.2-06-11 branch June 19, 2018 18:57
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.

1 participant