Existential scope of existential typeparameter changes unexpectedly


#1

The following fails, because the forSome existential scoping is inferred to the wrong level

case class A[T](t:T)

val isas = (1 to 4).map{ i =>
  val a: A[_] = A(i)
  (i, a)
}

val (is, as) = isas.unzip

with the error

error: No implicit view available from (Int, A[_$1]) forSome { type _$1 } => (A1, A2).
       val (is, as) = isas.unzip

Note that, surprisingly, the inferred type is (Int, A[_$1]) forSome { type _$1 } and not (Int, A[_$1] forSome { type _$1 }).


If we explicitly add type annotations as in the following example, it somehow glues the existential forSome to a and everything works

val isas2 = (1 to 4).map{ i =>
  val a: A[_] = A(i)
  (i, a): (Int, A[_])
}

val (is2, as2) = isas2.unzip

this behaviour looks very suspicuous…
why is the forSome put to the wrong place without extra type annotations?
Is this a bug?