From 5c243778279d8b258d7b1d34dd5146dff07eb437 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Fri, 16 Sep 2016 22:08:15 +0200 Subject: Add `MissingIdent` message to `Typer` --- src/dotty/tools/dotc/typer/Typer.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc') diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 32d5e0d96..b29254b89 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -65,6 +65,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit import tpd.{cpy => _, _} import untpd.cpy import Dynamic.isDynamicMethod + import reporting.diagnostic.MessageCreator import reporting.diagnostic.tpe._ /** A temporary data item valid for a single typed ident: @@ -98,7 +99,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit /** Method is necessary because error messages need to bind to * to typedIdent's context which is lost in nested calls to findRef */ - def error(msg: => String, pos: Position) = ctx.error(msg, pos) + def error(msg: => MessageCreator, pos: Position) = ctx.explainError(msg, pos) /** Is this import a root import that has been shadowed by an explicit * import in the same program? @@ -330,7 +331,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit if (rawType.exists) ensureAccessible(rawType, superAccess = false, tree.pos) else { - error(em"not found: $kind$name", tree.pos) + error(new MissingIdent(tree, kind, name), tree.pos) ErrorType } -- cgit v1.2.3