summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-07-18 21:05:23 +0000
committerPaul Phillips <paulp@improving.org>2011-07-18 21:05:23 +0000
commit44b9cf0ca9606f531218deefe7792b4476552291 (patch)
tree651f2e377985f29aa74748dcbd4b2bd26da71fd3 /test
parent658ba1b4e6898df65119f9cb6488ed8908c399ef (diff)
downloadscala-44b9cf0ca9606f531218deefe7792b4476552291.tar.gz
scala-44b9cf0ca9606f531218deefe7792b4476552291.tar.bz2
scala-44b9cf0ca9606f531218deefe7792b4476552291.zip
Modified erasure so we have enough information ...
Modified erasure so we have enough information to determine whether we need to use scala or java erasure semantics. This fixes the runtime failure illustrated here: % scala29 -e 'java.util.Collections.max(null)' java.lang.NoSuchMethodError: java.util.Collections.max(Ljava/util/Collection;)Ljava/lang/Comparable; Review by odersky.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/java-erasure.check1
-rw-r--r--test/files/run/java-erasure.scala10
2 files changed, 11 insertions, 0 deletions
diff --git a/test/files/run/java-erasure.check b/test/files/run/java-erasure.check
new file mode 100644
index 0000000000..f2ad6c76f0
--- /dev/null
+++ b/test/files/run/java-erasure.check
@@ -0,0 +1 @@
+c
diff --git a/test/files/run/java-erasure.scala b/test/files/run/java-erasure.scala
new file mode 100644
index 0000000000..c9f9b0ad51
--- /dev/null
+++ b/test/files/run/java-erasure.scala
@@ -0,0 +1,10 @@
+object Test {
+ val list = new java.util.ArrayList[String] { };
+ list add "a"
+ list add "c"
+ list add "b"
+
+ def main(args: Array[String]): Unit = {
+ println(java.util.Collections.max(list))
+ }
+}