Closed
Description
Compiler version
3.0.0-RC1
Minimized code
import scala.collection.Factory
final case class Gen[+A]() {
def take[C[X] <: Iterable[X], B](n: Int)(implicit w: A <:< C[B], f: Factory[B, C[B]]): Gen[C[B]] =
Gen()
}
object Usage {
def expected: Gen[List[Int]] =
Gen[List[Int]]().take(3)
}
Output
[error] 10 | Gen[List[Int]]().take(3)
[error] | ^
[error] |no implicit argument of type collection.Factory[Int, C[Int]] was found for parameter f of method take in class Gen.
[error] |I found:
[error] |
[error] | collection.Factory.arrayFactory[A]
[error] |
[error] |But method arrayFactory in object Factory does not match type collection.Factory[Int, C[Int]].
[error] |
[error] |The following import might fix the problem:
[error] |
[error] | import collection.immutable.List.iterableFactory
Expectation
It should compile successfully (it does in Scala 2.13).