Skip to content

Commit 97a3290

Browse files
authored
Merge pull request #4224 from dotty-staging/fix/duplicate-denot
Do not create multiple SymDenotation chains for the same symbol
2 parents e871cb5 + b4837e5 commit 97a3290

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3481,10 +3481,9 @@ object Types {
34813481
}
34823482

34833483
def appliedRef(implicit ctx: Context): Type = {
3484-
def clsDenot = if (prefix eq cls.owner.thisType) cls.denot else cls.denot.copySymDenotation(info = this)
34853484
if (appliedRefCache == null)
34863485
appliedRefCache =
3487-
TypeRef(prefix, cls.name, clsDenot).appliedTo(cls.typeParams.map(_.typeRef))
3486+
TypeRef(prefix, cls).appliedTo(cls.typeParams.map(_.typeRef))
34883487
appliedRefCache
34893488
}
34903489

compiler/src/dotty/tools/dotc/transform/TreeChecker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class TreeChecker extends Phase with SymTransformer {
6565
def testDuplicate(sym: Symbol, registry: mutable.Map[String, Symbol], typ: String)(implicit ctx: Context) = {
6666
val name = sym.fullName.mangledString
6767
if (this.flatClasses && registry.contains(name))
68-
printError(s"$typ defined twice $sym ${sym.id} ${registry(name).id}")
68+
assert(false, s"$typ defined twice $sym ${sym.id} ${registry(name).id}")
6969
registry(name) = sym
7070
}
7171

0 commit comments

Comments
 (0)