Skip to content

Commit 9b08b87

Browse files
committed
Don't report "not found" messages when we are looking for <error>.
1 parent 0b4d140 commit 9b08b87

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ trait TypeAssigner {
216216
else if (site.derivesFrom(defn.DynamicClass) && !Dynamic.isDynamicMethod(name)) {
217217
TryDynamicCallType
218218
} else {
219-
if (site.isErroneous) UnspecifiedErrorType
219+
if (site.isErroneous || name.toTermName == nme.ERROR) UnspecifiedErrorType
220220
else {
221221
def kind = if (name.isTypeName) "type" else "value"
222222
def addendum =

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
354354
// awaiting a better implicits based solution for library-supported xml
355355
return ref(defn.XMLTopScopeModuleRef)
356356
}
357+
else if (name.toTermName == nme.ERROR)
358+
UnspecifiedErrorType
357359
else
358360
errorType(new MissingIdent(tree, kind, name.show), tree.pos)
359361

0 commit comments

Comments
 (0)