diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index b2fead727e88..2cf525f4e328 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -251,9 +251,9 @@ class TreeUnpickler(reader: TastyReader, val space = readType() sname match { case SignedName(name, sig) => - TermRef(prefix, name, space.decl(name).atSignature(sig)) + TermRef(prefix, name, space.decl(name).asSeenFrom(prefix).atSignature(sig)) case name => - TermRef(prefix, name, space.decl(name)) + TermRef(prefix, name, space.decl(name).asSeenFrom(prefix)) } case TYPEREFin => val name = readName().toTypeName @@ -261,7 +261,7 @@ class TreeUnpickler(reader: TastyReader, val space = readType() space.decl(name) match { case symd: SymDenotation if prefix.isArgPrefixOf(symd.symbol) => TypeRef(prefix, symd.symbol) - case _ => TypeRef(prefix, name, space.decl(name)) + case _ => TypeRef(prefix, name, space.decl(name).asSeenFrom(prefix)) } case REFINEDtype => var name: Name = readName() diff --git a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala index d1019095edeb..f7dbda218e0e 100644 --- a/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala @@ -567,12 +567,6 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas // we need the checkNonCyclic call to insert LazyRefs for F-bounded cycles else if (!denot.is(Param)) tp1.underlyingIfRepeated(isJava = false) else tp1 - - if (!denot.isType) { // Only terms might have leaky aliases, see the documentation of `checkNoPrivateLeaks` - val sym = denot.symbol - denot.info = ctx.typeAssigner.avoidPrivateLeaks(sym, sym.pos) - } - if (denot.isConstructor) addConstructorTypeParams(denot) if (atEnd) { assert(!denot.isSuperAccessor, denot)