Toddobryan
06/23/2020, 5:25 PMkotlinc
on code that references Scala 2.12.11's List
(or any other class that references TraversableOnce
) causes the compiler to crash. A minimal example is:
import scala.collection.JavaConverters.asScalaBuffer
fun main() {
val kotlinList: List<String> = listOf("abc", "def", "ghi")
val scalaList = asScalaBuffer(kotlinList).toList
println(scalaList)
}
This works fine with Scala 2.12.10, but won’t even compile with Scala 2.12.11. The difference seems to be https://github.com/scala/scala/blob/v2.12.10/src/library/scala/collection/TraversableOnce.scala#L102 vs https://github.com/scala/scala/blob/v2.12.11/src/library/scala/collection/TraversableOnce.scala#L117 where they introduced a reverser
object that is confusing Kotlinc’s bytecode analysis.Toddobryan
06/23/2020, 7:19 PM