aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala
diff options
context:
space:
mode:
authorEnno Runne <enno@runne.net>2017-02-24 19:55:07 +0100
committerEnno Runne <enno@runne.net>2017-02-24 19:55:07 +0100
commitce333b1fe852c2a6cb62486f31d336f4ecaac275 (patch)
treef55236c39bb3ced64828cb08cfd98630ef7ce116 /compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala
parentdb24246e90f4b8afcaf1fc66df99d38d9a2cb736 (diff)
downloaddotty-ce333b1fe852c2a6cb62486f31d336f4ecaac275.tar.gz
dotty-ce333b1fe852c2a6cb62486f31d336f4ecaac275.tar.bz2
dotty-ce333b1fe852c2a6cb62486f31d336f4ecaac275.zip
Change 'overloaded/recursive method/value needs type' to Message (see #2026)
Diffstat (limited to 'compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala28
1 files changed, 28 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala
index 34190c114..8d34d97ed 100644
--- a/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala
+++ b/compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala
@@ -1146,4 +1146,32 @@ object messages {
|""".stripMargin
}
+ case class OverloadedOrRecursiveMethodNeedsResultType(tree: Names.TermName)(implicit ctx: Context)
+ extends Message(OverloadedOrRecursiveMethodNeedsResultTypeID) {
+ val kind = "Syntax"
+ val msg = hl"""overloaded or recursive method ${tree} needs result type"""
+ val explanation =
+ hl"""""".stripMargin
+ }
+
+ case class RecursiveValueNeedsResultType(tree: Names.TermName)(implicit ctx: Context)
+ extends Message(RecursiveValueNeedsResultTypeID) {
+ val kind = "Syntax"
+ val msg = hl"""recursive value ${tree.name} needs type"""
+ val explanation =
+ hl"""""".stripMargin
+ }
+
+ case class CyclicReferenceInvolvingImplicit(cycleSym: Symbol)(implicit ctx: Context)
+ extends Message(CyclicReferenceInvolvingImplicitID) {
+ val kind = "Syntax"
+ val msg = hl"""cyclic reference involving implicit $cycleSym"""
+ val explanation =
+ hl"""|This happens when the right hand-side of $cycleSym's definition involves an implicit search.
+ |To avoid the error, give $cycleSym an explicit type.
+ |""".stripMargin
+ }
+
+
+
}