From fe3b78b8644fe025e9ff742d79d9b69270993749 Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Thu, 12 Nov 2009 21:04:26 +0000 Subject: Merge branch 'ticket/2594' --- test/files/run/t2594_tcpoly.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/files/run/t2594_tcpoly.scala (limited to 'test/files/run/t2594_tcpoly.scala') diff --git a/test/files/run/t2594_tcpoly.scala b/test/files/run/t2594_tcpoly.scala new file mode 100644 index 0000000000..e759ca8b0f --- /dev/null +++ b/test/files/run/t2594_tcpoly.scala @@ -0,0 +1,18 @@ +trait Monad[M[_]] { + def foo[A](a: M[A]): M[A] +} + +class Bar[A, B] +class Bar1[A] { type And[B] = Bar[A, B] } + +object Test { + // the combination of partial applications and anonymous class is essential to reproduce the bug + // problem: missing bridge method + // --> abstractmethoderror `Main$$anon$1.foo(Ljava/lang/Object;)Ljava/lang/Object;` + // the anonymous class only gets `public Bar foo(Bar a)` + def BarMonad[X] = new Monad[Bar1[X]#And] { + def foo[A](a: Bar[X, A]) = a + } + + def main(as: Array[String]) { BarMonad[Int] foo (new Bar[Int, Int]) } +} \ No newline at end of file -- cgit v1.2.3