Skip to content

[ConstraintSolver] Skip generic overloads only if non-generic choices produce higher score solutions #9963

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 2 commits into from
Jun 2, 2017

Conversation

xedin
Copy link
Contributor

@xedin xedin commented May 28, 2017

Restrict skipping of the generic overloads only to the situations
when non-generic solution doesn't have any restrictions/fixes, because
there is a possibility that generic overload could produce a better
solution.

Resolves: rdar://problem/32204609.

@xedin xedin changed the title [WIP] [ConstraintSolver] Skip generic overloads only if non-generic choices produce higher score solutions [ConstraintSolver] Skip generic overloads only if non-generic choices produce higher score solutions May 29, 2017
@xedin
Copy link
Contributor Author

xedin commented May 29, 2017

@swift-ci please smoke test

@xedin xedin requested a review from rudkx May 29, 2017 00:46
@xedin
Copy link
Contributor Author

xedin commented May 29, 2017

@rudkx Could you please take a look and let me know if that's a good generic direction for this?

There is a test failure related to unmapped generic parameters in the solution in the IDE test, I'll debug that later if you think that this is a viable approach.

@xedin xedin force-pushed the rdar-32204609 branch 2 times, most recently from ef0d0f7 to c224c45 Compare May 29, 2017 00:49
@xedin
Copy link
Contributor Author

xedin commented May 31, 2017

/cc @DougGregor

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, and looking forward to the generalization of the new score kind to all pointer conversions.

Copy link
Contributor

@rudkx rudkx left a comment

Choose a reason for hiding this comment

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

LGTM!

xedin added 2 commits June 1, 2017 14:43
… produce higher score solutions

Restrict skipping of the generic overloads only to the situations
when non-generic solution doesn't have any restrictions/fixes, because
there is a possibility that generic overload could produce a better
solution.

Resolves: rdar://problem/32204609.
There are possible situations when we find solutions with String
and String -> UnsafePointer conversions at the same time for
expressions with default string literals. In order to disambiguite
such situations let's prefer solutions without String -> UnsafePointer
conversions if possible.
@xedin
Copy link
Contributor Author

xedin commented Jun 1, 2017

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Jun 1, 2017

@swift-ci please test source compatibility

@xedin xedin merged commit ea5a42d into swiftlang:master Jun 2, 2017
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.

3 participants