@@ -91,7 +91,7 @@ object Scala2Unpickler {
91
91
cls.enter(constr, scope)
92
92
}
93
93
94
- def setClassInfo (denot : ClassDenotation , info : Type , selfInfo : Type = NoType )(implicit ctx : Context ): Unit = {
94
+ def setClassInfo (denot : ClassDenotation , info : Type , fromScala2 : Boolean , selfInfo : Type = NoType )(implicit ctx : Context ): Unit = {
95
95
val cls = denot.classSymbol
96
96
val (tparams, TempClassInfoType (parents, decls, clazz)) = info match {
97
97
case TempPolyType (tps, cinfo) => (tps, cinfo)
@@ -106,9 +106,11 @@ object Scala2Unpickler {
106
106
else selfInfo
107
107
val tempInfo = new TempClassInfo (denot.owner.thisType, cls, decls, ost)
108
108
denot.info = tempInfo // first rough info to avoid CyclicReferences
109
+ val parents1 = if (parents.isEmpty) defn.ObjectType :: Nil else parents.map(_.dealias)
110
+ // Add extra parents to the tuple classes from the standard library
109
111
val normalizedParents =
110
- defn.adjustForTuple(cls, tparams,
111
- if (parents.isEmpty) defn. ObjectType :: Nil else parents.map(_.dealias))
112
+ if (fromScala2) defn.adjustForTuple(cls, tparams, parents1)
113
+ else parents1 // We are setting the info of a Java class, so it cannot be one of the tuple classes
112
114
for (tparam <- tparams) {
113
115
val tsym = decls.lookup(tparam.name)
114
116
if (tsym.exists) tsym.setFlag(TypeParam )
@@ -553,7 +555,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
553
555
denot match {
554
556
case denot : ClassDenotation =>
555
557
val selfInfo = if (atEnd) NoType else readTypeRef()
556
- setClassInfo(denot, tp, selfInfo)
558
+ setClassInfo(denot, tp, fromScala2 = true , selfInfo)
557
559
case denot =>
558
560
val tp1 = translateTempPoly(tp)
559
561
denot.info =
0 commit comments