summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-05-25 21:57:14 +0000
committerPaul Phillips <paulp@improving.org>2009-05-25 21:57:14 +0000
commit213285991d73a80b322c55000c69633893dccb80 (patch)
tree87313abebe991c8298771bfc5e316480fc123bad /src/compiler
parent4065255346820863bbc060bf4c34bb7353f3a0ae (diff)
downloadscala-213285991d73a80b322c55000c69633893dccb80.tar.gz
scala-213285991d73a80b322c55000c69633893dccb80.tar.bz2
scala-213285991d73a80b322c55000c69633893dccb80.zip
Modified UniqueTypes not to interfere with thei...
Modified UniqueTypes not to interfere with their hashCode. Should fix the random build failures involving missing keys (once it's in starr.)
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index 3db4e372aa..6bba3e74bf 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -818,8 +818,7 @@ trait Types {
// Subclasses ------------------------------------------------------------
trait UniqueType {
- private val hashcode = { val h = super.hashCode(); if (h < 0) -h else h }
- override def hashCode() = hashcode
+ override lazy val hashCode: Int = super.hashCode()
}
/** A base class for types that defer some operations
* to their immediate supertype.
@@ -2297,11 +2296,9 @@ A type's typeSymbol should never be inspected directly.
uniques = new HashSet(20000)
uniqueRunId = currentRunId
}
- val tp1 = uniques.findEntry(tp)
- if (tp1 eq null) {
- uniques.addEntry(tp); tp
- } else {
- tp1.asInstanceOf[T]
+ uniques.findEntry(tp) match {
+ case null => uniques.addEntry(tp); tp
+ case tp1 => tp1.asInstanceOf[T]
}
}