Skip to content

[SR-14280][CSSimplify] Increase the score when matching functions with different representations for contextual type #36208

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

Conversation

LucianoPAlmeida
Copy link
Contributor

@LucianoPAlmeida LucianoPAlmeida commented Feb 28, 2021

It does make sense to favor the same representation of contextual type, so increase the score when a function type is matching with different representations to avoid ambiguity. In this example, solver finds both bindings (@convention(block) () -> Void)? and (() -> ())?. Let me know what you think :)

Resolves: SR-14280
Resolves: rdar://74877828

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please smoke test

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

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

It does make sense to prefer the same representation if possible, thank you!

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please test Windows platform

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please smoke test macOS platform

@LucianoPAlmeida LucianoPAlmeida force-pushed the SR-14280-ambiguity-repr branch from 8b2d254 to f5f7204 Compare March 2, 2021 01:08
@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please smoke test

@xedin
Copy link
Contributor

xedin commented Mar 2, 2021

@swift-ci please smoke test Windows platform

@xedin
Copy link
Contributor

xedin commented Mar 2, 2021

@swift-ci please test source compatibility

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please test Windows Platform

@LucianoPAlmeida
Copy link
Contributor Author

@swift-ci Please test source compatibility Release

@LucianoPAlmeida LucianoPAlmeida merged commit d4a5282 into swiftlang:main Mar 2, 2021
@LucianoPAlmeida
Copy link
Contributor Author

Thanks @xedin :)

@LucianoPAlmeida LucianoPAlmeida deleted the SR-14280-ambiguity-repr branch March 2, 2021 21:39
@xedin
Copy link
Contributor

xedin commented Mar 2, 2021

Thank you! Don't forget to resolve the SR.

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