Skip to content

Commit bf45e65

Browse files
committed
Better error message for adaptations of implicit methods
Ig an implicit method has a result type which does not match the expected type, the new case fires. We avoid to diagnose missing arguments, because that's really confusing for an implicit method.
1 parent dc16bad commit bf45e65

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
12451245
typed(etaExpand(tree, wtp, arity), pt)
12461246
else if (wtp.paramTypes.isEmpty)
12471247
adaptInterpolated(tpd.Apply(tree, Nil), pt, EmptyTree)
1248+
else if (wtp.isImplicit)
1249+
err.typeMismatch(tree, pt)
12481250
else
12491251
errorTree(tree,
12501252
d"""missing arguments for $methodStr

0 commit comments

Comments
 (0)