diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala b/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala index 888413257f..a485272ca6 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala @@ -150,12 +150,8 @@ trait TypeKinds { self: ICodes => val tp = global.lub(List(tk1.toType, tk2.toType)) val (front, rest) = tp.parents span (_.typeSymbol.hasTraitFlag) - if (front.isEmpty) tp - else if (rest.isEmpty) front.head // all parents are interfaces - else rest.head match { - case AnyRefClass | ObjectClass => tp - case x => x - } + if (front.isEmpty || rest.isEmpty || rest.head.typeSymbol == ObjectClass) tp + else rest.head } def isIntLub = ( |