diff options
author | Paul Phillips <paulp@improving.org> | 2010-09-20 03:47:24 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-09-20 03:47:24 +0000 |
commit | 9563f21b20a03d3c36e3eac20b563a0c3900faac (patch) | |
tree | bf5c26fcac15bd6e5088fbe2b6272485c898f81a /test/files/run | |
parent | df90c36a13d51ef27b9d07c60760322260250538 (diff) | |
download | scala-9563f21b20a03d3c36e3eac20b563a0c3900faac.tar.gz scala-9563f21b20a03d3c36e3eac20b563a0c3900faac.tar.bz2 scala-9563f21b20a03d3c36e3eac20b563a0c3900faac.zip |
Test case closes #2162, no review.
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)) + } +} |