diff options
author | Martin Odersky <odersky@gmail.com> | 2014-11-08 12:07:47 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-11-09 19:09:52 +0100 |
commit | 0d0a37f755bece2b44de65ce4bbcf34184813fae (patch) | |
tree | 709c3ff1ac72706a5ba9acbe6197eb4195883c95 /src/dotty/tools/dotc/typer/Typer.scala | |
parent | a8cd662ce26e915fb045bfd34b7ac9aa88f69721 (diff) | |
download | dotty-0d0a37f755bece2b44de65ce4bbcf34184813fae.tar.gz dotty-0d0a37f755bece2b44de65ce4bbcf34184813fae.tar.bz2 dotty-0d0a37f755bece2b44de65ce4bbcf34184813fae.zip |
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.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 2 |
1 files changed, 2 insertions, 0 deletions
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 |