Closed
Description
Compiler version
3.1.2-RC1
First bad commit 3ab18a9 in #14026
Minimized code
object ImplNotFound:
def main(args: Array[String]): Unit =
val res: Seq[String | Int] = (??? : Seq[Int]).collect {
case 1 => Seq("")
case 2 => Seq(1)
}.flatten
Output
[error] -- Error: /.../ImplNotFound.scala:6:13
[error] 6 | }.flatten
[error] | ^
[error] |no implicit argument of type Seq[Matchable] => IterableOnce[B] was found for parameter asIterable of method flatten in trait IterableOps
[error] |
[error] |where: B is a type variable with constraint <: String | Int
Expectation
Successful compilation as in 3.0.0
to 3.1.1