File tree Expand file tree Collapse file tree 2 files changed +4
-13
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -899,15 +899,4 @@ object messages {
899
899
val msg = hl " trying to define package with same name as ` $existing` "
900
900
val explanation = " "
901
901
}
902
-
903
- case class CyclicImplicitVal (cycleSym : Symbol )(implicit ctx : Context )
904
- extends Message (34 ) {
905
- val kind = " Cyclic Reference"
906
- val msg = em " cyclic reference involving $cycleSym"
907
- val explanation =
908
- hl """ |This happens when the right hand-side of $cycleSym's definition
909
- |involves an implicit search.
910
- |
911
- |To avoid the error, give $cycleSym an explicit type. """
912
- }
913
902
}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ object ErrorReporting {
28
28
29
29
def cyclicErrorMsg (ex : CyclicReference )(implicit ctx : Context ) = {
30
30
val cycleSym = ex.denot.symbol
31
- def errorMsg (msg : String , cx : Context ): Message =
31
+ def errorMsg (msg : String , cx : Context ): String =
32
32
if (cx.mode is Mode .InferringReturnType ) {
33
33
cx.tree match {
34
34
case tree : untpd.ValOrDefDef =>
@@ -48,7 +48,9 @@ object ErrorReporting {
48
48
} else msg
49
49
50
50
if (cycleSym.is(Implicit , butNot = Method ) && cycleSym.owner.isTerm)
51
- CyclicImplicitVal (cycleSym)
51
+ em """ cyclic reference involving implicit $cycleSym
52
+ |This happens when the right hand-side of $cycleSym's definition involves an implicit search.
53
+ |To avoid the error, give $cycleSym an explicit type. """
52
54
else
53
55
errorMsg(ex.show, ctx)
54
56
}
You can’t perform that action at this time.
0 commit comments