From 44b9cf0ca9606f531218deefe7792b4476552291 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 18 Jul 2011 21:05:23 +0000 Subject: 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. --- test/files/run/java-erasure.check | 1 + test/files/run/java-erasure.scala | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 test/files/run/java-erasure.check create mode 100644 test/files/run/java-erasure.scala (limited to 'test/files') 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)) + } +} -- cgit v1.2.3