-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Changes to overloading #1389
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
Changes to overloading #1389
Conversation
Is this as specified or should we make a note that we need to update the spec? |
We should make a note to update the spec. I am sure there are other small details that are different as well; notably in how the expected return type is handled. |
/rebuild |
} | ||
} | ||
|
||
var found = resolveOverloaded(alts, pt, Nil)(ctx.retractMode(Mode.ImplicitsEnabled)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could avoid the var
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would you propose to avoid it?
That is all. |
Actually you should also add a test that involves implicits in one or both functions. |
Fix scala#1381: Overloading is now changed so that we first try without implicit searches. Only if that leaves no applicable alternatives we try again with implicit search turned on. This also fixes test case t2660, which got moved from neg to pos.
Adds the original test form scala#1381. t2660 looks similar. Also adds some unrelated tests I had in the queue that now compile.
rebased to master |
class C2 extends C1 { | ||
def f(x: B): Unit = println("B") | ||
} | ||
object Test extends C2 with App { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests should probably be in run
to check if the correct overload of f
is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for class Foo
above.
Another insufficient memory failure /rebuild |
/rebuild |
We seem to have memory problems again. |
@nicolasstucki Can you add the necessary tests? I won't have time to do it before leaving on my trip. Thanks! |
I'll add the tests on tomorrow. |
@nicolsstucki Thanks for adding the tests. |
Fix #1381: Overloading is now changed so that we first try without implicit searches.
Only if that leaves no applicable alternatives we try again with implicit search turned on.
This also fixes test case t2660, which got moved from neg to pos.
Review by @smarter or @nicolasstucki