https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
s

spierce7

03/03/2022, 7:59 PM
What are the plans for Kotlin and multiplatform inline classes, now that inline classes have been deprecated?
d

darkmoon_uk

03/03/2022, 8:15 PM
I don't know if they're deprecated, so much as renamed to 'value classes'. Given this, would there be any difference between single and multi platform use cases? Replace
inline class
with
value class
= happy days?
If it's not that simple I'm keen to know as well.
s

spierce7

03/03/2022, 8:35 PM
So it’s weird, because it has different behavior on the JVM if you don’t use
@JvmInline
. Maybe I misunderstood the blog post when it came out. I thought you could only achieve inlining on the JVM via the
value
keyword and
@JvmInline
. Maybe everything is working on multiplatform as an inline class just with the
value
keyword.
b

Big Chungus

03/03/2022, 9:05 PM
@JvmInline is here to future proof value classes for jvm. There's currently experimental support for inlining classes in jvm17 already, once that's stable, value classes without @JvmInline will reuse jvm native inlining capabilities instead of kotlin workarounds for it. Hope that clarifies things.
s

spierce7

03/04/2022, 2:29 AM
thanks for clearing that up
3 Views