Skip to content

[CSBindings] Open collection before binding parameter only if origina… #30113

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 28, 2020

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Feb 28, 2020

…l argument type failed

Instead of always opening argument type represented by a collection
without type variables (to support subtyping when element is a labeled tuple),
let's try original type first and if that fails use a slower path with
indirection which attempts array upcast. Doing it this way helps to
propagate contextual information faster which fixes a performance regression.

Resolves: rdar://problem/54580247
Resolves: rdar://problem/57138194

…l argument type failed

Instead of always opening argument type represented by a collection
without type variables (to support subtyping when element is a labeled tuple),
let's try original type first and if that fails use a slower path with
indirection which attempts `array upcast`. Doing it this way helps to
propagate contextual information faster which fixes a performance regression.

Resolves: rdar://problem/54580247
@xedin xedin requested a review from DougGregor February 28, 2020 00:27
@xedin
Copy link
Contributor Author

xedin commented Feb 28, 2020

@swift-ci please smoke test

@xedin
Copy link
Contributor Author

xedin commented Feb 28, 2020

@swift-ci please test source compatibility

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@xedin xedin merged commit c0b9394 into swiftlang:master Feb 28, 2020
xedin added a commit to xedin/swift that referenced this pull request Mar 16, 2020
…indings

This is a follow-up to swiftlang#30113
which cased a regression because it was placed under a check which
allows direct supertypes to be inferred if previous (failing) binding
has a supertype as well which has nothing to do with collection
inference.

Let's combine supertype check and inference logic to avoid such
confusion in the future.

Resolves: rdar://problem/60501780
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