From 6e2cadb8bd42e0f4a6c777b11ff71f92cda368e8 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 16 Sep 2013 12:55:10 +0200 Subject: 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 --- test/files/pos/t7847/A.scala | 5 +++++ test/files/pos/t7847/B.java | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 test/files/pos/t7847/A.scala create mode 100644 test/files/pos/t7847/B.java (limited to 'test/files/pos') 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); + } +} -- cgit v1.2.3