Skip to content

Commit a147797

Browse files
authored
Merge pull request #2483 from dotty-staging/fix-stainless
Fixes for compiling stainless with dotty
2 parents c564511 + 409a9f5 commit a147797

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

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

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -467,16 +467,13 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
467467

468468
def finishSym(sym: Symbol): Symbol = {
469469
if (sym.isClass) sym.setFlag(Scala2x)
470-
val owner = sym.owner
471-
if (owner.isClass &&
472-
!( isUnpickleRoot(sym)
473-
|| (sym is Scala2Existential)
474-
|| isRefinementClass(sym)
475-
)
476-
)
477-
owner.asClass.enter(sym, symScope(owner))
478-
else if (isRefinementClass(owner))
479-
symScope(owner).openForMutations.enter(sym)
470+
if (!(isRefinementClass(sym) || isUnpickleRoot(sym) || (sym is Scala2Existential))) {
471+
val owner = sym.owner
472+
if (owner.isClass)
473+
owner.asClass.enter(sym, symScope(owner))
474+
else if (isRefinementClass(owner))
475+
symScope(owner).openForMutations.enter(sym)
476+
}
480477
sym
481478
}
482479

@@ -560,6 +557,12 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
560557
// we need the checkNonCyclic call to insert LazyRefs for F-bounded cycles
561558
else if (!denot.is(Param)) tp1.underlyingIfRepeated(isJava = false)
562559
else tp1
560+
561+
if (!denot.isType) { // Only terms might have leaky aliases, see the documentation of `checkNoPrivateLeaks`
562+
val sym = denot.symbol
563+
denot.info = ctx.typeAssigner.avoidPrivateLeaks(sym, sym.pos)
564+
}
565+
563566
if (denot.isConstructor) addConstructorTypeParams(denot)
564567
if (atEnd) {
565568
assert(!denot.isSuperAccessor, denot)

0 commit comments

Comments
 (0)