From 16eaefb35cdea0f0380a7c5bda395f9b863bf8b3 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Tue, 29 Jan 2013 18:44:31 +0100 Subject: SI-6572 Test case, originally fixed in a3680be. That fix has now been backported to 2.10.x in the previous commit. This commit should be be merged to master. --- test/files/run/t6572/bar_1.scala | 19 +++++++++++++++++++ test/files/run/t6572/foo_2.scala | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 test/files/run/t6572/bar_1.scala create mode 100644 test/files/run/t6572/foo_2.scala (limited to 'test') diff --git a/test/files/run/t6572/bar_1.scala b/test/files/run/t6572/bar_1.scala new file mode 100644 index 0000000000..5518ced7af --- /dev/null +++ b/test/files/run/t6572/bar_1.scala @@ -0,0 +1,19 @@ +package bar + +abstract class IntBase[V] extends Base[Int, V] + +class DefaultIntBase[V <: IntProvider] extends IntBase[V] { + override protected def hashCode(key: Int) = key +} + +trait IntProvider { + def int: Int +} + +abstract class Base[@specialized K, V] { + + protected def hashCode(key: K) = key.hashCode + + def get(key: K): V = throw new RuntimeException + +} \ No newline at end of file diff --git a/test/files/run/t6572/foo_2.scala b/test/files/run/t6572/foo_2.scala new file mode 100644 index 0000000000..465f0b7c3c --- /dev/null +++ b/test/files/run/t6572/foo_2.scala @@ -0,0 +1,17 @@ +//package foo + +import bar._ + +class FooProvider extends IntProvider { + def int = 3 +} + +class Wrapper(users: DefaultIntBase[FooProvider]) { + final def user(userId: Int) = users.get(userId) +} + +object Test { + def main(args: Array[String]) { + new Wrapper(new DefaultIntBase) + } +} \ No newline at end of file -- cgit v1.2.3