diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-12-13 10:21:16 +0100 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-12-13 10:21:16 +0100 |
commit | 559e49317912ce52c51e295346cebcafbb69462d (patch) | |
tree | bd5114adfa0f0e7362614cb637f3f4218a1870f9 /compiler/src/dotty/tools/dotc/typer | |
parent | 2082307f725b208393044ddb21df753a5329f8ac (diff) | |
download | dotty-559e49317912ce52c51e295346cebcafbb69462d.tar.gz dotty-559e49317912ce52c51e295346cebcafbb69462d.tar.bz2 dotty-559e49317912ce52c51e295346cebcafbb69462d.zip |
Add CyclicImplicitVal error to messages
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer')
-rw-r--r-- | compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala b/compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala index a066fc04a..5709bfbf9 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): String = + def errorMsg(msg: String, cx: Context): Message = if (cx.mode is Mode.InferringReturnType) { cx.tree match { case tree: untpd.ValOrDefDef => @@ -48,9 +48,7 @@ object ErrorReporting { } else msg if (cycleSym.is(Implicit, butNot = Method) && cycleSym.owner.isTerm) - 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.""" + CyclicImplicitVal(cycleSym) else errorMsg(ex.show, ctx) } |