diff options
Diffstat (limited to 'src/dotty/tools/dotc/reporting/diagnostic/tpe.scala')
-rw-r--r-- | src/dotty/tools/dotc/reporting/diagnostic/tpe.scala | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/reporting/diagnostic/tpe.scala b/src/dotty/tools/dotc/reporting/diagnostic/tpe.scala index 4aa24c440..ee221f80d 100644 --- a/src/dotty/tools/dotc/reporting/diagnostic/tpe.scala +++ b/src/dotty/tools/dotc/reporting/diagnostic/tpe.scala @@ -4,7 +4,7 @@ package reporting package diagnostic import dotc.core._ -import Contexts.Context, Decorators._, Symbols._ +import Contexts.Context, Decorators._, Symbols._, Names._ import dotc.printing.SyntaxHighlighting._ import util.{SourcePosition, NoSourcePosition} @@ -35,13 +35,21 @@ object tpe { val caseDef = s"case $pat$guard => $body" - hl"""|Explanation - |=========== - |For each ${"case"} bound variable names have to be unique. In: + hl"""|For each ${"case"} bound variable names have to be unique. In: | |$caseDef | |`${bind.name}` is not unique. Rename one of the bound variables!""".stripMargin } } + + class MissingIdent(tree: untpd.Ident, treeKind: String, name: Name)(implicit ctx: Context) extends MessageCreator { + val kind = "Missing identifier" + val msg = em"not found: $treeKind$name" + + val explanation = { + hl"""|An identifier for `${name.show}` is missing. This means that something + |has either been misspelt or you're forgetting an import""".stripMargin + } + } } |