aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/RefChecks.scala4
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Typer.scala5
2 files changed, 7 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala
index ada53047a..eab91701b 100644
--- a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala
+++ b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala
@@ -767,6 +767,7 @@ import RefChecks._
class RefChecks extends MiniPhase { thisTransformer =>
import tpd._
+ import reporting.diagnostic.messages.ForwardReferenceExtendsOverDefinition
override def phaseName: String = "refchecks"
@@ -789,8 +790,7 @@ class RefChecks extends MiniPhase { thisTransformer =>
if (sym.exists && sym.owner.isTerm && !sym.is(Lazy))
currentLevel.levelAndIndex.get(sym) match {
case Some((level, symIdx)) if symIdx < level.maxIndex =>
- ctx.debuglog("refsym = " + level.refSym)
- ctx.error(s"forward reference extends over definition of $sym", level.refPos)
+ ctx.error(ForwardReferenceExtendsOverDefinition(sym, level.refSym), level.refPos)
case _ =>
}
tree
diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala
index e04667223..2b57cf778 100644
--- a/compiler/src/dotty/tools/dotc/typer/Typer.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -351,6 +351,11 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
val ownType =
if (rawType.exists)
ensureAccessible(rawType, superAccess = false, tree.pos)
+ else if (name == nme._scope) {
+ // gross hack to support current xml literals.
+ // awaiting a better implicits based solution for library-supported xml
+ return ref(defn.XMLTopScopeModuleRef)
+ }
else
errorType(new MissingIdent(tree, kind, name.show), tree.pos)