diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 2f3e13c89847..c30f711c6096 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -3481,10 +3481,9 @@ object Types { } def appliedRef(implicit ctx: Context): Type = { - def clsDenot = if (prefix eq cls.owner.thisType) cls.denot else cls.denot.copySymDenotation(info = this) if (appliedRefCache == null) appliedRefCache = - TypeRef(prefix, cls.name, clsDenot).appliedTo(cls.typeParams.map(_.typeRef)) + TypeRef(prefix, cls).appliedTo(cls.typeParams.map(_.typeRef)) appliedRefCache } diff --git a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala index 2fc388373f12..2508c984bf59 100644 --- a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala +++ b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala @@ -65,7 +65,7 @@ class TreeChecker extends Phase with SymTransformer { def testDuplicate(sym: Symbol, registry: mutable.Map[String, Symbol], typ: String)(implicit ctx: Context) = { val name = sym.fullName.mangledString if (this.flatClasses && registry.contains(name)) - printError(s"$typ defined twice $sym ${sym.id} ${registry(name).id}") + assert(false, s"$typ defined twice $sym ${sym.id} ${registry(name).id}") registry(name) = sym }