aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/ErrorReporting.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-07-21 18:50:15 +0200
committerMartin Odersky <odersky@gmail.com>2014-08-03 17:28:33 +0200
commit3065790f8536f8a6c088d6c6115f71ce45ca5ae0 (patch)
tree17c65e88bfa367d8f895bfb55a53ddb07eb575e7 /src/dotty/tools/dotc/typer/ErrorReporting.scala
parent9d90361eeb76f3b090a96033e20ed1a272c3493c (diff)
downloaddotty-3065790f8536f8a6c088d6c6115f71ce45ca5ae0.tar.gz
dotty-3065790f8536f8a6c088d6c6115f71ce45ca5ae0.tar.bz2
dotty-3065790f8536f8a6c088d6c6115f71ce45ca5ae0.zip
Added utility method: underlyingSymbol
Diffstat (limited to 'src/dotty/tools/dotc/typer/ErrorReporting.scala')
-rw-r--r--src/dotty/tools/dotc/typer/ErrorReporting.scala9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/ErrorReporting.scala b/src/dotty/tools/dotc/typer/ErrorReporting.scala
index 89e73013f..f20d25792 100644
--- a/src/dotty/tools/dotc/typer/ErrorReporting.scala
+++ b/src/dotty/tools/dotc/typer/ErrorReporting.scala
@@ -6,7 +6,7 @@ import ast._
import core._
import Trees._
import Types._, ProtoTypes._, Contexts._, Decorators._, Denotations._, Symbols._
-import Applications._, Implicits._
+import Applications._, Implicits._, Flags._
import util.Positions._
import printing.Showable
import printing.Disambiguation.disambiguated
@@ -48,6 +48,13 @@ object ErrorReporting {
class Errors(implicit ctx: Context) {
+ /** An explanatory note to be added to error messages
+ * when there's a problem with abstract var defs */
+ def abstractVarMessage(sym: Symbol): String =
+ if (sym.underlyingSymbol.is(Mutable))
+ "\n(Note that variables need to be initialized to be defined)"
+ else ""
+
def expectedTypeStr(tp: Type): String = tp match {
case tp: FunProto =>
val result = tp.resultType match {