diff options
author | Paul Phillips <paulp@improving.org> | 2013-08-15 15:02:18 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-08-17 08:22:51 -0700 |
commit | b1d72f1ac7b4b2026c4fad3453195db8bb2918bc (patch) | |
tree | 31dbd5a7598056ef1a5e32bc4c39d3bb202297d5 /src/compiler/scala/tools/nsc/transform/patmat/Logic.scala | |
parent | 87d80ff0618e5bd964b37201371b91683e57df5d (diff) | |
download | scala-b1d72f1ac7b4b2026c4fad3453195db8bb2918bc.tar.gz scala-b1d72f1ac7b4b2026c4fad3453195db8bb2918bc.tar.bz2 scala-b1d72f1ac7b4b2026c4fad3453195db8bb2918bc.zip |
Cosmetic cleanup in the matcher.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/patmat/Logic.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/patmat/Logic.scala | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/patmat/Logic.scala b/src/compiler/scala/tools/nsc/transform/patmat/Logic.scala index 069484ff65..e49dd22948 100644 --- a/src/compiler/scala/tools/nsc/transform/patmat/Logic.scala +++ b/src/compiler/scala/tools/nsc/transform/patmat/Logic.scala @@ -13,7 +13,6 @@ import scala.reflect.internal.util.Statistics import scala.reflect.internal.util.Position import scala.reflect.internal.util.HashSet - trait Logic extends Debugging { import PatternMatchingStats._ @@ -494,7 +493,7 @@ trait ScalaLogic extends Interface with Logic with TreeAndTypeAnalysis { import global.{ConstantType, Constant, SingletonType, Literal, Ident, singleType} - import global.definitions.{AnyClass, UnitClass} + import global.definitions._ // all our variables range over types @@ -549,7 +548,7 @@ trait ScalaLogic extends Interface with Logic with TreeAndTypeAnalysis { def tp: Type def wideTp: Type - def isAny = wideTp.typeSymbol == AnyClass + def isAny = wideTp =:= AnyTpe def isValue: Boolean //= tp.isStable // note: use reference equality on Const since they're hash-consed (doing type equality all the time is too expensive) @@ -606,7 +605,7 @@ trait ScalaLogic extends Interface with Logic with TreeAndTypeAnalysis { if (tp.isInstanceOf[SingletonType]) tp else p match { case Literal(c) => - if (c.tpe.typeSymbol == UnitClass) c.tpe + if (c.tpe =:= UnitTpe) c.tpe else ConstantType(c) case Ident(_) if p.symbol.isStable => // for Idents, can encode uniqueness of symbol as uniqueness of the corresponding singleton type |