With the below MRE I would expect the following output:
$ scala mre.scala
1
object Main {
def main(args: Array[String]): Unit = {
implicit val thing = List[String]().map(_.to(List))
for (x <- 1 to 1) {
println(x)
}
}
}
However what I do get is the following
$ scala mre.scala
mre.scala:4: error: type mismatch;
found : Int(1)
required: scala.collection.Factory[Char,?]
for (x <- 1 to 1) {
If I remove either the implicit or the .map(_.to(List)) then it works as expected.
What on earth is going on here? I have no idea where to even begin.
$ scala --version
Scala code runner version 2.13.7 -- Copyright 2002-2021, LAMP/EPFL and Lightbend, Inc.