Hello! Want to use value classes in multiplatform project in common source, but have faced with compiltion error. If not annotating value class with JvmInline got error for jvm target, else got error in js target for unresolved Jvminline annotation.
g
Gavin Ray
12/10/2022, 10:29 PM
You may need to use
expect
and
actual
Copy code
expect value class Foo(val a: String)
@JvmInline
actual value class Foo(val a: String)
e
ephemient
12/10/2022, 11:24 PM
you should be able to use the
@JvmInline
annotation in common sources, as long as you import it first