summaryrefslogtreecommitdiff
path: root/src/compiler/scala/reflect/internal/Types.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-11-24 02:01:00 +0000
committerPaul Phillips <paulp@improving.org>2011-11-24 02:01:00 +0000
commit2b069593c84194e21f88b8552ad12917decc14d5 (patch)
tree9d37331201d02b6cd9c5b11c742957c738bb4e16 /src/compiler/scala/reflect/internal/Types.scala
parent93717598b711a69822d802e06873ed7b00f89898 (diff)
downloadscala-2b069593c84194e21f88b8552ad12917decc14d5.tar.gz
scala-2b069593c84194e21f88b8552ad12917decc14d5.tar.bz2
scala-2b069593c84194e21f88b8552ad12917decc14d5.zip
Minor restructuring in Implicits.
Another case where I tried to get into the performance party but ended up playing dungeons and dragons next door. However I did come away with an attractive tablecloth, which I draped over Implicits.scala before waving my magic wand. TRANSLATION: it's probably not faster but it's still better.
Diffstat (limited to 'src/compiler/scala/reflect/internal/Types.scala')
-rw-r--r--src/compiler/scala/reflect/internal/Types.scala12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/compiler/scala/reflect/internal/Types.scala b/src/compiler/scala/reflect/internal/Types.scala
index 0f8d28ff03..a69db8e0f4 100644
--- a/src/compiler/scala/reflect/internal/Types.scala
+++ b/src/compiler/scala/reflect/internal/Types.scala
@@ -5559,9 +5559,15 @@ A type's typeSymbol should never be inspected directly.
isSubType(tp1, tp2)
}
- def isNumericSubType(tp1: Type, tp2: Type) =
- isNumericValueType(tp1) && isNumericValueType(tp2) &&
- isNumericSubClass(tp1.typeSymbol, tp2.typeSymbol)
+ /** The isNumericValueType tests appear redundant, but without them
+ * test/continuations-neg/function3.scala goes into an infinite loop.
+ * (Even if the calls are to typeSymbolDirect.)
+ */
+ def isNumericSubType(tp1: Type, tp2: Type) = (
+ isNumericValueType(tp1)
+ && isNumericValueType(tp2)
+ && isNumericSubClass(tp1.typeSymbol, tp2.typeSymbol)
+ )
private val lubResults = new mutable.HashMap[(Int, List[Type]), Type]
private val glbResults = new mutable.HashMap[(Int, List[Type]), Type]