When upgrading Kotlin from 2.3.10 to 2.3.20 I am n...
# multiplatform
e
When upgrading Kotlin from 2.3.10 to 2.3.20 I am no longer able to use
@JvmRecord
in
commonMain
. I get errors in non jvm compilation tasks. That look similar to:
Cannot access 'java.lang.Record' which is a supertype of 'Vector2'. Check your module classpath for missing or conflicting dependencies.
I can't find relevant issues on Youtrack, this works in 2.3.10 and in older versions of Kotlin.
plus one 2
a
I have the same issue, do you have any info about it?
e
sadly no. I will file the issue tonight or tomorrow if it hasn't been done so by now
a
I couldnt find any issue regarding this behavior change today. It is not working for me in 2.3.20, 2.3.21-RC, and 2.4.0-beta1. I tried in my open source project https://github.com/Dussim/viessmann-api/tree/changes on branch
changes
I can just change in libs.versions.toml a
jetbrains-kotlin =
entry to one of mentioned versions and then I cannot compile my
:api:feature:common
module anymore
e
I made a small project to reproduce it. Basically just using `@JvmRecord`inside a sourceset that is shared by non jvm compilation tasks is a enough to trigger the error
That project builds ok with 2.3.10 but breaks with 2.3.20
Just makes you wonder if anyone is using the
@JvmRecord
annotation 🙂
a
My project is more for fun and learning and I found out having records instead of plain classes leads to higher performance somehow, but I would probably need to benchmark it properly
e
I have seen a (small) performance gain when I checked it with a JMH based benchmark.