diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-04-20 10:18:24 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-04-20 10:18:24 +0200 |
commit | 4f2a20e843c0f07352dff87767cad13636942a3e (patch) | |
tree | 17722dfe4b669bf8f28ee4d4495ab6e981af3734 /test/files | |
parent | 804a4cc1ff9fa159c576be7c685dbb81220c11da (diff) | |
parent | 468deadf2aad90fbb61036c66cfa298f33ff6009 (diff) | |
download | scala-4f2a20e843c0f07352dff87767cad13636942a3e.tar.gz scala-4f2a20e843c0f07352dff87767cad13636942a3e.tar.bz2 scala-4f2a20e843c0f07352dff87767cad13636942a3e.zip |
Merge pull request #5098 from sjrd/simplify-scala-runtime
Simplify scala.runtime
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/t5644/BoxesRunTime.java | 4 | ||||
-rw-r--r-- | test/files/run/hashCodeBoxesRunTime.scala | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/test/files/pos/t5644/BoxesRunTime.java b/test/files/pos/t5644/BoxesRunTime.java index 74c4c6b4b9..2b931519aa 100644 --- a/test/files/pos/t5644/BoxesRunTime.java +++ b/test/files/pos/t5644/BoxesRunTime.java @@ -267,10 +267,6 @@ public final class BoxesRunTime else if (n instanceof java.lang.Float) return hashFromFloat((java.lang.Float)n); else return n.hashCode(); } - public static int hashFromObject(Object a) { - if (a instanceof Number) return hashFromNumber((Number)a); - else return a.hashCode(); - } private static int unboxCharOrInt(Object arg1, int code) { if (code == CHAR) diff --git a/test/files/run/hashCodeBoxesRunTime.scala b/test/files/run/hashCodeBoxesRunTime.scala index ba1a30f5fb..8ad94c252a 100644 --- a/test/files/run/hashCodeBoxesRunTime.scala +++ b/test/files/run/hashCodeBoxesRunTime.scala @@ -3,7 +3,8 @@ object Test { import java.{ lang => jl } - import scala.runtime.BoxesRunTime.{ hashFromNumber, hashFromObject } + import scala.runtime.BoxesRunTime.hashFromNumber + import scala.runtime.ScalaRunTime.{ hash => hashFromAny } def allSame[T](xs: List[T]) = assert(xs.distinct.size == 1, "failed: " + xs) @@ -17,7 +18,7 @@ object Test val hashes = mkNumbers(n) map hashFromNumber allSame(hashes) if (n >= 0) { - val charCode = hashFromObject(n.toChar: Character) + val charCode = hashFromAny(n.toChar: Character) assert(charCode == hashes.head) } } |