We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This compiles with scalac but not with dotty:
import scala.util.Random object Test { def test = { val rand = new Random rand.shuffle(List(1,2)) // fails } }
try/t6948b.scala:6: error: no implicit argument of type scala.collection.generic.CanBuildFrom[ (CC? >: ([+HK$0] => scala.collection.immutable.List[HK$0])[HK$0 =+ (T? >: Int)] <: ([HK$0] => <: scala.collection.TraversableOnce[HK$0]) )[(T? >: Int)]#Apply , (T? >: Int), (CC? >: ([+HK$0] => scala.collection.immutable.List[HK$0])[HK$0 =+ (T? >: Int)] <: ([HK$0] => <: scala.collection.TraversableOnce[HK$0]) )[(T? >: Int)]#Apply ] found for parameter bf of method shuffle in class Random rand.shuffle(List(1,2)) ^ one error found
But explicitly doing an implicit search is enough to make it work:
import scala.util.Random import scala.collection.generic._ import scala.collection.immutable._ object Test { implicit val z: CanBuildFrom[List[Int], Int, List[Int]] = implicitly[CanBuildFrom[List[Int], Int, List[Int]]] // succeeds def test = { val rand = new Random rand.shuffle(List(1,2)) // now succeeds } }
The text was updated successfully, but these errors were encountered:
Fixed by #799.
Sorry, something went wrong.
No branches or pull requests
This compiles with scalac but not with dotty:
But explicitly doing an implicit search is enough to make it work:
The text was updated successfully, but these errors were encountered: