diff options
author | Paul Phillips <paulp@improving.org> | 2011-09-16 16:49:39 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-09-16 16:49:39 +0000 |
commit | c69b0aecc604d3298341a0731fba967f88175dac (patch) | |
tree | 0b2e19ed0840b6457498ddab0c4aaf0b00befb82 | |
parent | 9ffe29d61ad3d70193790e7ee74a8d351047fe94 (diff) | |
download | scala-c69b0aecc604d3298341a0731fba967f88175dac.tar.gz scala-c69b0aecc604d3298341a0731fba967f88175dac.tar.bz2 scala-c69b0aecc604d3298341a0731fba967f88175dac.zip |
Fix for nonsense comparison in TypeKinds.
Hey, that new warning works. No review.
-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 = ( |