Skip to content

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.

// 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