From 0d0a37f755bece2b44de65ce4bbcf34184813fae Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 8 Nov 2014 12:07:47 +0100 Subject: 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. --- src/dotty/tools/dotc/typer/Typer.scala | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/dotty/tools/dotc/typer/Typer.scala') diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 59fda174d..a5396d445 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -1245,6 +1245,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit typed(etaExpand(tree, wtp, arity), pt) else if (wtp.paramTypes.isEmpty) adaptInterpolated(tpd.Apply(tree, Nil), pt, EmptyTree) + else if (wtp.isImplicit) + err.typeMismatch(tree, pt) else errorTree(tree, d"""missing arguments for $methodStr -- cgit v1.2.3