Skip to content

[4.1][CSBindings] Look through optional types when trying to validate l-va… #14490

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
Feb 9, 2018

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Feb 8, 2018

…lueness of the new bindings

Explanation: When bindings are picked for particular type variable, right-hand
side of the binding might be another type variable wrapped into optional
type, when trying to determine if both sides of the binding have the
same l-valueness it's imperative to look through optional type of the
right-hand side. Otherwise new binding might be effectively unsolvable.
Scope of Issue: Affects logic related to picking bindings for type variables in constraint solver.
Origination: Looks like this might be caused by re-work which happened when mustBeMaterializable has been split.
Risk: Low risk; Fixes a bug in constraint solver.
Reviewed By: @rudkx
Testing: Compiler regression tests
Radar / SR: rdar://problem/37291371

Resolves: rdar://problem/37291371
(cherry picked from commit c6ff7b4)

@xedin xedin requested a review from rudkx February 8, 2018 20:00
@xedin
Copy link
Contributor Author

xedin commented Feb 8, 2018

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Feb 8, 2018

@swift-ci please test source compatibility

Copy link
Contributor

@rudkx rudkx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@xedin xedin changed the title [CSBindings] Look through optional types when trying to validate l-va… [4.1][CSBindings] Look through optional types when trying to validate l-va… Feb 8, 2018
…lueness of the new bindings

When bindings are picked for particular type variable, right-hand
side of the binding might be another type variable wrapped into optional
type, when trying to determine if both sides of the binding have the
same l-valueness it's imperative to look throught optional type of the
right-hand side. Otherwise new binding might be effectively unsolvable.

Resolves: rdar://problem/37291371
(cherry picked from commit c6ff7b4)
@xedin xedin force-pushed the rdar-37291371-4.1 branch from 28611dd to cdc2902 Compare February 8, 2018 20:37
@swiftlang swiftlang deleted a comment from swift-ci Feb 8, 2018
@xedin
Copy link
Contributor Author

xedin commented Feb 8, 2018

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Feb 8, 2018

@swift-ci please test source compatibility

@xedin
Copy link
Contributor Author

xedin commented Feb 8, 2018

@swift-ci please nominate

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