diff options
author | Paul Phillips <paulp@improving.org> | 2013-01-31 23:10:21 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-01-31 23:10:21 -0800 |
commit | 36f78dd6060ac753c3a7707b3d5ca3afb300f915 (patch) | |
tree | 5996d19e0d14dfbd47424e0be1a03967d0014c2d /test/files/run | |
parent | 110b54a575278cfdd04672b5ff170a68060ff245 (diff) | |
parent | 16eaefb35cdea0f0380a7c5bda395f9b863bf8b3 (diff) | |
download | scala-36f78dd6060ac753c3a7707b3d5ca3afb300f915.tar.gz scala-36f78dd6060ac753c3a7707b3d5ca3afb300f915.tar.bz2 scala-36f78dd6060ac753c3a7707b3d5ca3afb300f915.zip |
Merge pull request #2006 from retronym/backport/1226
[backport] SI-6301 / SI-6572 specialization regressions
Diffstat (limited to 'test/files/run')
-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 |