Skip to content

[5.5][CSBindings] Don't infer subtypes/supertype bindings for a closure type #37322

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
May 10, 2021

Conversation

xedin
Copy link
Contributor

@xedin xedin commented May 7, 2021

  • Explanation:

Fixes a crash during invalid solution application which was formed
due to incorrect inference of a closure type.

A type representing a closure expression is always bound to its
"inferred" type based on the body, so contextual bindings just
serve as a trigger to "resolve" a closure. Let's not attempt any
subtype/supertype inference for a type variable representing a
closure since if "direct" bindings have failed, it wouldn't be bound
to such types regardless.

Resolves: rdar://77022842
(cherry picked from commit 3c0388d)

A type representing a closure expression is always bound to its
"inferred" type based on the body, so contextual bindings just
serve as a trigger to "resolve" a closure. Let's not attempt any
subtype/supertype inference for a type variable representing a
closure since if "direct" bindings have failed, it wouldn't be bound
to such types regardless.

Resolves: rdar://problem/77022842
(cherry picked from commit 3c0388d)
@xedin xedin added the r5.5 label May 7, 2021
@xedin xedin requested a review from a team as a code owner May 7, 2021 18:11
@xedin
Copy link
Contributor Author

xedin commented May 7, 2021

@swift-ci please test

@tkremenek tkremenek merged commit 4dc7250 into swiftlang:release/5.5 May 10, 2021
@AnthonyLatsis AnthonyLatsis added swift 5.5 🍒 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.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants