Skip to content

[Sema] In simplifyType, if substitution fails retry with IUOs stripped. #7196

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 2, 2017
Merged

Conversation

rudkx
Copy link
Contributor

@rudkx rudkx commented Feb 2, 2017

We can end up with IUOs bound as a result of overload resolution. When
this happens and the resulting type is used as a generic, we can end up
with dependent member types that fail to simplify properly as a result
of failing to substitute due to the IUO getting in the way. In these
cases it should be completely safe to strip the IUO off and retry
substitution with the base type.

This isn't really an ideal fix by any means, and we need to revisit how
we handle bindings to make it more uniform, but for now I think this is
a reasonable path to move forward.

Fixes a source compatibility regression.

rdar://problem/29960575

(cherry picked from ecedb33 with edits
to handle conflicts between branches)

We can end up with IUOs bound as a result of overload resolution. When
this happens and the resulting type is used as a generic, we can end up
with dependent member types that fail to simplify properly as a result
of failing to substitute due to the IUO getting in the way. In these
cases it should be completely safe to strip the IUO off and retry
substitution with the base type.

This isn't really an ideal fix by any means, and we need to revisit how
we handle bindings to make it more uniform, but for now I think this is
a reasonable path to move forward.

Fixes a source compatibility regression.

rdar://problem/29960575

(cherry picked from ecedb33 with edits
to handle conflicts between branches)
@rudkx rudkx added this to the Swift 3.1 milestone Feb 2, 2017
@rudkx
Copy link
Contributor Author

rudkx commented Feb 2, 2017

@swift-ci Please smoke test

1 similar comment
@rudkx
Copy link
Contributor Author

rudkx commented Feb 2, 2017

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Feb 2, 2017

@swift-ci Please test

@tkremenek tkremenek merged commit d7f2fc8 into swiftlang:swift-3.1-branch Feb 2, 2017
@rudkx rudkx deleted the fix-29960575-3.1 branch February 13, 2017 22:36
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