diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/bug2162.check | 2 | ||||
-rw-r--r-- | test/files/run/bug2162.scala | 19 |
2 files changed, 21 insertions, 0 deletions
diff --git a/test/files/run/bug2162.check b/test/files/run/bug2162.check new file mode 100644 index 0000000000..87729eb41a --- /dev/null +++ b/test/files/run/bug2162.check @@ -0,0 +1,2 @@ +B.foo[Bar] +A.foo[Bar] diff --git a/test/files/run/bug2162.scala b/test/files/run/bug2162.scala new file mode 100644 index 0000000000..fe576a8e2d --- /dev/null +++ b/test/files/run/bug2162.scala @@ -0,0 +1,19 @@ +class Foo(x: Int) +class Bar extends Foo(1) + +trait A { + def foo[T <: Foo] +} +class B extends A { + def foo[Bar] { println("B.foo[Bar]") } +} +object Test { + val x = new B + val y = new A { + def foo[Bar] { println("A.foo[Bar]") } + } + def main(args: Array[String]) { + x.foo // ok + y.foo // java.lang.AssertionError: assertion failed (Erasure.scala:441 in r18338)) + } +} |