Skip to content

Commit 0c5ca76

Browse files
committed
Add MissingIdent message to Typer
1 parent dff4f6d commit 0c5ca76

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
6464
import tpd.{cpy => _, _}
6565
import untpd.cpy
6666
import Dynamic.isDynamicMethod
67+
import reporting.diagnostic.MessageCreator
6768
import reporting.diagnostic.tpe._
6869

6970
/** A temporary data item valid for a single typed ident:
@@ -97,7 +98,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
9798
/** Method is necessary because error messages need to bind to
9899
* to typedIdent's context which is lost in nested calls to findRef
99100
*/
100-
def error(msg: => String, pos: Position) = ctx.error(msg, pos)
101+
def error(msg: => MessageCreator, pos: Position) = ctx.explainError(msg, pos)
101102

102103
/** Is this import a root import that has been shadowed by an explicit
103104
* import in the same program?
@@ -325,7 +326,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
325326
if (rawType.exists)
326327
ensureAccessible(rawType, superAccess = false, tree.pos)
327328
else {
328-
error(em"not found: $kind$name", tree.pos)
329+
error(new MissingIdent(tree, kind, name), tree.pos)
329330
ErrorType
330331
}
331332

0 commit comments

Comments
 (0)