Skip to content

Disable checkNoPrivateLeaks when unpickling #4133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,17 @@ 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
val prefix = readType()
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down