aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-12-15 15:43:09 +0100
committerMartin Odersky <odersky@gmail.com>2016-12-15 15:43:09 +0100
commitbc869e74cb18ffdb4d42b59ad654f55403b9b6bd (patch)
treed9864e5b540ea7df66047422e0d5c43db7363fe0 /compiler/src/dotty/tools/dotc/typer
parent559e49317912ce52c51e295346cebcafbb69462d (diff)
downloaddotty-bc869e74cb18ffdb4d42b59ad654f55403b9b6bd.tar.gz
dotty-bc869e74cb18ffdb4d42b59ad654f55403b9b6bd.tar.bz2
dotty-bc869e74cb18ffdb4d42b59ad654f55403b9b6bd.zip
Add CyclicImplicitVal error to messages (reverted from commit 559e49317912ce52c51e295346cebcafbb69462d)
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala b/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala
index 5709bfbf9..a066fc04a 100644
--- a/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala
+++ b/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala
@@ -28,7 +28,7 @@ object ErrorReporting {
def cyclicErrorMsg(ex: CyclicReference)(implicit ctx: Context) = {
val cycleSym = ex.denot.symbol
- def errorMsg(msg: String, cx: Context): Message =
+ def errorMsg(msg: String, cx: Context): String =
if (cx.mode is Mode.InferringReturnType) {
cx.tree match {
case tree: untpd.ValOrDefDef =>
@@ -48,7 +48,9 @@ object ErrorReporting {
} else msg
if (cycleSym.is(Implicit, butNot = Method) && cycleSym.owner.isTerm)
- CyclicImplicitVal(cycleSym)
+ em"""cyclic reference involving implicit $cycleSym
+ |This happens when the right hand-side of $cycleSym's definition involves an implicit search.
+ |To avoid the error, give $cycleSym an explicit type."""
else
errorMsg(ex.show, ctx)
}