From c69b0aecc604d3298341a0731fba967f88175dac Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 16 Sep 2011 16:49:39 +0000 Subject: Fix for nonsense comparison in TypeKinds. Hey, that new warning works. No review. --- src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') 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 = ( -- cgit v1.2.3