Skip to content

Commit b80cd90

Browse files
authored
Merge pull request #4133 from dotty-staging/fix-#2678
Disable checkNoPrivateLeaks when unpickling
2 parents c1ad60e + defcf29 commit b80cd90

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,17 +251,17 @@ class TreeUnpickler(reader: TastyReader,
251251
val space = readType()
252252
sname match {
253253
case SignedName(name, sig) =>
254-
TermRef(prefix, name, space.decl(name).atSignature(sig))
254+
TermRef(prefix, name, space.decl(name).asSeenFrom(prefix).atSignature(sig))
255255
case name =>
256-
TermRef(prefix, name, space.decl(name))
256+
TermRef(prefix, name, space.decl(name).asSeenFrom(prefix))
257257
}
258258
case TYPEREFin =>
259259
val name = readName().toTypeName
260260
val prefix = readType()
261261
val space = readType()
262262
space.decl(name) match {
263263
case symd: SymDenotation if prefix.isArgPrefixOf(symd.symbol) => TypeRef(prefix, symd.symbol)
264-
case _ => TypeRef(prefix, name, space.decl(name))
264+
case _ => TypeRef(prefix, name, space.decl(name).asSeenFrom(prefix))
265265
}
266266
case REFINEDtype =>
267267
var name: Name = readName()

compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -567,12 +567,6 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
567567
// we need the checkNonCyclic call to insert LazyRefs for F-bounded cycles
568568
else if (!denot.is(Param)) tp1.underlyingIfRepeated(isJava = false)
569569
else tp1
570-
571-
if (!denot.isType) { // Only terms might have leaky aliases, see the documentation of `checkNoPrivateLeaks`
572-
val sym = denot.symbol
573-
denot.info = ctx.typeAssigner.avoidPrivateLeaks(sym, sym.pos)
574-
}
575-
576570
if (denot.isConstructor) addConstructorTypeParams(denot)
577571
if (atEnd) {
578572
assert(!denot.isSuperAccessor, denot)

0 commit comments

Comments
 (0)