summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-09-16 12:55:10 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-09-16 13:00:15 +0200
commit6e2cadb8bd42e0f4a6c777b11ff71f92cda368e8 (patch)
tree21bc371b4fa165c2b0ac882d8d9a2527d7d9ab13 /test
parent6a81025ab2f9a798c8b12eea8f8e7e4e83d3b6e4 (diff)
downloadscala-6e2cadb8bd42e0f4a6c777b11ff71f92cda368e8.tar.gz
scala-6e2cadb8bd42e0f4a6c777b11ff71f92cda368e8.tar.bz2
scala-6e2cadb8bd42e0f4a6c777b11ff71f92cda368e8.zip
SI-7847 Static forwarders for case apply/unapply
These were excluded in f901816b3f because at the time they were compiler fiction and translated to calls to the case class constructor or accessors. But since they are now bona-fide methods (albeit still occasionally bypassed as an optimization), we can expose them conveniently to our Java brethren. The cut-and-pastiness of GenBCode starts to hinder maintenance. Here's a report of further duplication that we have to fix up post haste: https://gist.github.com/retronym/6334389
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/t7847/A.scala5
-rw-r--r--test/files/pos/t7847/B.java10
2 files changed, 15 insertions, 0 deletions
diff --git a/test/files/pos/t7847/A.scala b/test/files/pos/t7847/A.scala
new file mode 100644
index 0000000000..b6cce6ee79
--- /dev/null
+++ b/test/files/pos/t7847/A.scala
@@ -0,0 +1,5 @@
+case class Blah(a: Int)
+
+object Blah {
+ def apply2(a: Int) = apply(a)
+}
diff --git a/test/files/pos/t7847/B.java b/test/files/pos/t7847/B.java
new file mode 100644
index 0000000000..c214f2dcab
--- /dev/null
+++ b/test/files/pos/t7847/B.java
@@ -0,0 +1,10 @@
+public final class B {
+ void blah() {
+ Blah x = Blah.apply2(1);
+ Blah y = Blah.apply(1);
+ Blah z = Blah$.MODULE$.apply(1);
+
+ scala.Option un1 = Blah.unapply(null);
+ scala.Option un2 = Blah$.MODULE$.unapply(null);
+ }
+}