Skip to content

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jan 15, 2020

If we are left with several alternatives after normal overloadiong resolution
and the expected result type is not a FunProto, prefer the alternatives
that do not have a method result type. This makes i2378 compile, so it got
moved to a pos test.

If we are left with several alternatives after normal overloadiong resolution
and the expected result type is not a FunProto, prefer the alternatives
that do not have a method result type. This makes i2378 compile, so it got
moved to a pos test.
The error that was checked for in the test is no more.
The previous code did not compose correctly with the "no defaults" criterion
that followed.
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM

// prefer alternatives that need no eta expansion
val noCurried = alts.filter(!resultIsMethod(_))
val noCurriedCount = noCurried.length
if noCurried.length == 1 then
Copy link
Contributor

Choose a reason for hiding this comment

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

As pointed out by @michelou , we can just use noCurriedCount instead of noCurried.length .

Co-Authored-By: Fengyun Liu <liu@fengy.me>
@odersky odersky merged commit 10c7668 into scala:master Jan 15, 2020
@odersky odersky deleted the fix-#7401 branch January 15, 2020 17:14
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