aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Implicits.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-05-07 10:28:30 +0200
committerMartin Odersky <odersky@gmail.com>2016-05-23 16:11:45 +0200
commit22d1ad46f77bfe89e901a5576bc722f748bd7e19 (patch)
tree0b9b640e2154ad1823dc8776818e4a65621a8b9f /src/dotty/tools/dotc/typer/Implicits.scala
parenta88de62e5d60fe8ba83d99bd463797e6b173e3d1 (diff)
downloaddotty-22d1ad46f77bfe89e901a5576bc722f748bd7e19.tar.gz
dotty-22d1ad46f77bfe89e901a5576bc722f748bd7e19.tar.bz2
dotty-22d1ad46f77bfe89e901a5576bc722f748bd7e19.zip
Make use of implicitNotFound for eqaulity errors
Needed a fix in string interpolation for suriviving inserted types that contain `$` characters.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Implicits.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Implicits.scala4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala
index 091bf49f9..f7823b2b3 100644
--- a/src/dotty/tools/dotc/typer/Implicits.scala
+++ b/src/dotty/tools/dotc/typer/Implicits.scala
@@ -477,9 +477,7 @@ trait Implicits { self: Typer =>
def assumedCanEqual = ltp.isError || rtp.isError || ltp <:< rtp || rtp <:< ltp
if (!ctx.isAfterTyper && !assumedCanEqual) {
val res = inferImplicitArg(
- defn.EqType.appliedTo(ltp, rtp),
- _ => ctx.error(d"Values of types $ltp and $rtp cannot be compared with == or !=", pos),
- pos)
+ defn.EqType.appliedTo(ltp, rtp), msgFun => ctx.error(msgFun(""), pos), pos)
implicits.println(i"Eq witness found: $res: ${res.tpe}")
}
}