Skip to content

Commit 1fad643

Browse files
committed
Select operations in erasure should fix symbols in types.
Otherwise we get binding races, e.g. for pos/t2133.scala after mixin because we create same-named symbols in subclasses, and type refs now can refer to the subclass symbol where previously they refereed to the superclass symbol. To avoid a data race the new term ref will have a fixed symbol.
1 parent 3299df8 commit 1fad643

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/transform/Erasure.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ object Erasure extends TypeTestsCasts{
277277
case _ => sym.name
278278
}
279279
untpd.cpy.Select(tree)(qual, sym.name)
280-
.withType(NamedType.withSymAndName(qual.tpe, sym, name))
280+
.withType(NamedType.withFixedSym(qual.tpe, sym))
281281
}
282282

283283
def selectArrayMember(qual: Tree, erasedPre: Type): Tree =

0 commit comments

Comments
 (0)