Another thing I bumped into while switching to
kotest
is using
shouldThrow
in our tests. We are getting an error with the message:
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
.
I got around to it by specifying the highest jvm version we could go with in `build.gradle.kts`:
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "12"
}
However, I did not have to specify this in
kotlintest
and I wish we could keep it that way.
What is the root cause of seeing this error? How
kotest
changed that triggered it? - This is for my own educational purpose.
Also (this might be a
#gradle question), is it possible to specify this constraint for tests only in gradle?