OK. After more testing, it turns out that trying t...
# announcements
t
OK. After more testing, it turns out that trying to use
kotlinc
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:
Copy code
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.
👍 3
I filed a bug: https://youtrack.jetbrains.com/issue/KT-39799 It’s actually a duplicate of https://youtrack.jetbrains.com/issue/KT-38325 but I’m going to let JetBrains decide how to resolve them since I thought the second one was a runtime bug and not a compiler bug until I read it really closely.