I'm not sure if this is really related to Kotest. ...
# kotest
l
I'm not sure if this is really related to Kotest. This piece of code I see in every kotlin project
a
Which one? The
jvmTarget
?
l
Yes
Usually targetting JVM 8 tho hahah
a
I see.
l
That usually means that your gradle project is targetting 1.6
While Kotest was compiled with 1.8
And for that reason you can't inline the code, as they're not compatible
Not sure if that's just that tho. But this error have a big question at StackOverflow hahah
a
This is a noob quesiton: so this setting is not going to target a specific jvm, it just gives directives to the Kotlin compiler to generate more modern (possibly Jvm 1.8 compatible) byte code.
m
As Leonardo said, Kotlintest was compiled against 1.6 before, and if you don't explicitly state a jvmTarget, then the Kotlin compiler uses 1.6. Kotest is compiled against 1.8. Your project is still targeting 1.6. So you can't use the
inline
from a 1.8 on the 1.6 JVM. What you put with
withType<Test>
will target only test tasks. Hopefully that helps. Are you targetting older versions of Android, or still using JDK 1.6 for your dev? Otherwise, may as well target 1.8 as there are a number of JVM improvements that allow for 'better' bytecode generation.
a
Thank you for the info! This and reading up on it helped a ton. 💯
s
Could we compile kotest to 1.6?
I'm not sure if we're using anything from 1.8 specifically? We might be.
a
shouldThrow
was the only thing complaining.
s
that comes from kotest-assertions
it might be that entire package not sure