https://kotlinlang.org logo
#getting-started
Title
# getting-started
c

Carrascado

07/27/2020, 5:18 PM
Does anyone know why would Kotlin need to target specifically Java 8 for compiling in some cases? What features of Kotlin do need that? It has happened to me after trying some property based testing in Kotest (https://github.com/kotest/kotest), it said
Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
and it got fixed setting the project to compile into Java 8 with kotlinOptions What I understand from the error message is that some part of the library is directly injecting bytecodes meant for the JVM 1.8? I'd like to know more about this kind of details but I don't find much info searching by myself, maybe I'm not writing the right keywords when searching
t

tseisel

07/27/2020, 8:59 PM
Correct me if I'm wrong, but I think that's because the library itself has been compiled to Java 8 bytecode, therefore it cannot copy bytecode of inline functions to the function of a project targeting an older version
2 Views