diff options
-rw-r--r-- | test/files/run/t6572/bar_1.scala | 19 | ||||
-rw-r--r-- | test/files/run/t6572/foo_2.scala | 17 |
2 files changed, 36 insertions, 0 deletions
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 |