File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -1620,11 +1620,11 @@ class Definitions {
16201620
16211621 /** If `cls` is Tuple1..Tuple22, add the corresponding *: type as last parent to `parents` */
16221622 def adjustForTuple (cls : ClassSymbol , tparams : List [TypeSymbol ], parents : List [Type ]): List [Type ] = {
1623- def syntheticParent ( tparams : List [ TypeSymbol ]) : Type =
1624- if ( tparams.isEmpty) TupleTypeRef
1625- else TypeOps .nestedPairs(tparams.map(_.typeRef))
1626- if (isTupleClass(cls)) parents :+ syntheticParent(tparams )
1627- else parents
1623+ if ! isTupleClass(cls) then parents
1624+ else if tparams.isEmpty then parents :+ TupleTypeRef
1625+ else
1626+ assert( parents.head.typeSymbol == ObjectClass )
1627+ TypeOps .nestedPairs(tparams.map(_.typeRef)) :: parents.tail
16281628 }
16291629
16301630 /** If it is BoxedUnit, remove `java.io.Serializable` from `parents`. */
Original file line number Diff line number Diff line change @@ -349,11 +349,7 @@ object TypeOps:
349349 val doms = dominators(commonBaseClasses, Nil )
350350 def baseTp (cls : ClassSymbol ): Type =
351351 tp.baseType(cls).mapReduceOr(identity)(mergeRefinedOrApplied)
352- def meet (tp1 : Type , tp2 : Type ) =
353- if ! tp1.exists then tp2
354- else if ! tp2.exists then tp1
355- else AndType (tp1, tp2)
356- doms.map(baseTp).reduceLeft(meet)
352+ doms.map(baseTp).reduceLeft(AndType .apply)
357353 }
358354
359355 tp match {
You can’t perform that action at this time.
0 commit comments