Skip to content

Fix #4600: method could be inside block in argument implicit resolution #4628

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 8, 2018

Conversation

liufengyun
Copy link
Contributor

Fix #4600: method could be inside block in argument implicit resolution

Scalac incorrectly rejects tests/pos/i4600b.scala, with this fix Dotty accepts the code.

@@ -2258,7 +2264,7 @@ class Typer extends Namer

// If method has default params, fall back to regular application
// where all inferred implicits are passed as named args.
if (tree.symbol.hasDefaultParams && !propFail.isInstanceOf[AmbiguousImplicits]) {
if (methSymbol.hasDefaultParams && !propFail.isInstanceOf[AmbiguousImplicits]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You could use methPart(tree).symbol

@@ -0,0 +1,26 @@
import scala.language.dynamics
Copy link
Contributor

Choose a reason for hiding this comment

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

I would make this a run test

@allanrenucci allanrenucci merged commit 6c6571d into scala:master Jun 8, 2018
@allanrenucci allanrenucci deleted the fix-4600 branch June 8, 2018 15:44
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.

Implicit Argument / vararg with Dynamic Trait fails
2 participants