summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2016-05-18 09:42:37 +1000
committerJason Zaugg <jzaugg@gmail.com>2016-05-18 14:23:32 +1000
commitd3e10c0b0aa95408873072262f0d728b96cfd885 (patch)
tree83f4743d881a569641b7a46e63f5ba18cfe6bc70
parent4a7f82c9047d04d79aa0fe4c0f8dc249ba221f76 (diff)
downloadscala-d3e10c0b0aa95408873072262f0d728b96cfd885.tar.gz
scala-d3e10c0b0aa95408873072262f0d728b96cfd885.tar.bz2
scala-d3e10c0b0aa95408873072262f0d728b96cfd885.zip
SI-8756 Test to demonstrate the status quo
Java generic signatures assume that refinement types should be boxed. Why did `g2` in the test seem to be immune to this bug demonstrated by `f2`? Because we opt to elide the generic signature altogether when no generics are involved.
-rw-r--r--test/files/run/t8756.check9
-rw-r--r--test/files/run/t8756.scala22
2 files changed, 31 insertions, 0 deletions
diff --git a/test/files/run/t8756.check b/test/files/run/t8756.check
new file mode 100644
index 0000000000..89337543bd
--- /dev/null
+++ b/test/files/run/t8756.check
@@ -0,0 +1,9 @@
+public Bippy<java.lang.Object> Test.f1(long)
+public Bippy<java.lang.Object> Test.f2(java.lang.Object)
+public Bippy<java.lang.Object> Test.i1(Bippy<java.lang.Object>)
+public Bippy<java.lang.Object> Test.i2(Bippy<java.lang.Object>)
+public int Test.g1(long)
+public int Test.g2(long)
+public java.lang.Object Test.h1(long)
+public java.lang.Object Test.h2(long)
+public static void Test.main(java.lang.String[])
diff --git a/test/files/run/t8756.scala b/test/files/run/t8756.scala
new file mode 100644
index 0000000000..edd243473a
--- /dev/null
+++ b/test/files/run/t8756.scala
@@ -0,0 +1,22 @@
+trait Bippy[A]
+
+class Test {
+ type T1 = Long
+ type T2 = Long { type Tag = Nothing }
+
+ def f1(t: T1): Bippy[Object] = ???
+ def f2(t: T2): Bippy[Object] = ???
+ def g1(t: T1): Int = ???
+ def g2(t: T2): Int = ???
+ def h1(t: T1): Object = ???
+ def h2(t: T2): Object = ???
+ def i1(t: Bippy[T1]): Bippy[T1] = ???
+ def i2(t: Bippy[T2]): Bippy[T2] = ???
+
+}
+
+object Test {
+ def main(args: Array[String]) {
+ println(classOf[Test].getDeclaredMethods.map(_.toGenericString).toList.sorted.mkString("\n"))
+ }
+}