diff options
author | Martin Odersky <odersky@gmail.com> | 2012-01-21 11:22:28 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2012-01-21 11:22:28 +0100 |
commit | 2e092d4822d044312317c502badd8ad5c2674b58 (patch) | |
tree | 6af7abc5fec2521c62d9d3ac9a7eb015b15d8054 /test | |
parent | 14ef1090325c3b85aa8c2dd7911445ec7e934743 (diff) | |
download | scala-2e092d4822d044312317c502badd8ad5c2674b58.tar.gz scala-2e092d4822d044312317c502badd8ad5c2674b58.tar.bz2 scala-2e092d4822d044312317c502badd8ad5c2674b58.zip |
Fix for problem in SBT that was caused by the too severe fix of type soundness problem t5120.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t5120.scala | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/files/pos/t5120.scala b/test/files/pos/t5120.scala new file mode 100644 index 0000000000..2c193d129d --- /dev/null +++ b/test/files/pos/t5120.scala @@ -0,0 +1,26 @@ +// An example extracted from SBT by Iulian +// that showed that the previous fix to t5120 +// was too strict. +class Test { + class ScopedKey[T] + class Value[T] + + class Compiled[T](val settings: Seq[Pair[T]]) + + case class Pair[T](k: ScopedKey[T], v: ScopedKey[T]) + + def transform[T](x: T) = x + + def test(compiledSettings: Seq[Compiled[_]]) = { + compiledSettings flatMap { cs => // cd: Compiled[_] in both versions + (cs.settings map { s => // cs.settings: Seq[Compiled[$1]] in trunk, Seq[Compiled[$1]] forSome $1 in 2.9.1 + // s: Pair[$1] in trunk, Pair[$1] in 2.9.1 + val t = transform(s.v) // t: ScopedKey[_] in trunk, ScopedKey[$1] in 2.9.1 + foo(s.k, t) + t + }) : Seq[ScopedKey[_]] + } + } + + def foo[T](x: ScopedKey[T], v: ScopedKey[T]) {} +} |