Skip to content

[4.2][ConstraintSystem] Reinstate favoring more specialized of two generic overloads. #17383

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
Jun 21, 2018

Conversation

rudkx
Copy link
Contributor

@rudkx rudkx commented Jun 21, 2018

  • Explanation: Fix a source compatibility issue caused by an expression type checker performance improvement we added which sometimes selected a different function overload to use during type checking. When comparing functions with optional-typed parameters, we were selecting the wrong function. This change makes the performance improvement more narrow by no longer kicking in when optionals are involved.
  • Scope: Any project that defines exactly two overloads of a generic function could hit the issue.
  • Issue #: rdar://problem/41109953
  • Risk: Small.
  • Testing: Standard regression tests plus source compatibility tests.
  • Reviewer: @DougGregor

… overloads.

This was originally commited in
3d32e89, and then backed out in
c40fd39 due to concern over
behavioral changes.

This version avoids the optimization when there are any optional types
involved in the signatures of the functions.

For these cases, compareDeclarations can return the wrong order at the
moment.

I have another PR in the works that attempts to begin unraveling some
of the issues around fixing the overload comparisons.

(cherry picked from commit 1a2d7f5)
@rudkx rudkx changed the title [4.2][ConstraintSystem] Reinstate favoring more specialized of two generic… [4.2][ConstraintSystem] Reinstate favoring more specialized of two generic overloads. Jun 21, 2018
@rudkx
Copy link
Contributor Author

rudkx commented Jun 21, 2018

@swift-ci Please test

@shahmishal
Copy link
Member

@swift-ci please nominate

@rudkx rudkx merged commit c9749c3 into swiftlang:swift-4.2-branch-06-11-2018 Jun 21, 2018
@rudkx rudkx deleted the rdar41109953-4.2-06-11 branch June 21, 2018 05:34
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