diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-01-29 18:44:31 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-01-29 19:01:08 +0100 |
commit | 16eaefb35cdea0f0380a7c5bda395f9b863bf8b3 (patch) | |
tree | 6fe369e30eff98123c3c623dbd66e424b740e856 /test/files/run/t6572 | |
parent | 0679da5440869d170df8a485db03532f9f49e04f (diff) | |
download | scala-16eaefb35cdea0f0380a7c5bda395f9b863bf8b3.tar.gz scala-16eaefb35cdea0f0380a7c5bda395f9b863bf8b3.tar.bz2 scala-16eaefb35cdea0f0380a7c5bda395f9b863bf8b3.zip |
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.
Diffstat (limited to 'test/files/run/t6572')
-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 |