aboutsummaryrefslogtreecommitdiff
path: root/compiler/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src')
-rw-r--r--compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala7
-rw-r--r--compiler/src/dotty/tools/dotc/transform/PostTyper.scala1
2 files changed, 8 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
index 79408ddde..1d23a902a 100644
--- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
+++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala
@@ -14,6 +14,7 @@ import scala.annotation.{tailrec, switch}
import scala.collection.mutable.ListBuffer
import scala.collection.{ mutable, immutable }
import config.Printers.pickling
+import typer.Checking
/** Unpickler for typed trees
* @param reader the reader from which to unpickle
@@ -732,6 +733,12 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table, posUnpickle
// no longer necessary.
goto(end)
setPos(start, tree)
+
+ // This is also done in PostTyper but needs to be redone here
+ if (!sym.is(SyntheticOrPrivate) && sym.owner.isClass) {
+ sym.info = Checking.checkNoPrivateLeaks(sym, tree.pos)
+ }
+ tree
}
private def readTemplate(implicit ctx: Context): Template = {
diff --git a/compiler/src/dotty/tools/dotc/transform/PostTyper.scala b/compiler/src/dotty/tools/dotc/transform/PostTyper.scala
index 1ed47d92e..e7c0df1b9 100644
--- a/compiler/src/dotty/tools/dotc/transform/PostTyper.scala
+++ b/compiler/src/dotty/tools/dotc/transform/PostTyper.scala
@@ -107,6 +107,7 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisTran
private def transformMemberDef(tree: MemberDef)(implicit ctx: Context): Unit = {
val sym = tree.symbol
sym.transformAnnotations(transformAnnot)
+ // Has to be redone in TreeUnpickler
if (!sym.is(SyntheticOrPrivate) && sym.owner.isClass) {
val info1 = Checking.checkNoPrivateLeaks(sym, tree.pos)
if (info1 ne sym.info)