File: t5120.scala

package info (click to toggle)
scala 2.11.12-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 62,924 kB
  • sloc: javascript: 28,808; java: 13,415; xml: 3,135; sh: 1,620; python: 756; makefile: 38; awk: 36; ansic: 6
file content (26 lines) | stat: -rw-r--r-- 833 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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[Tuple2[T]])

  case class Tuple2[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]) {}
}