I've been using the expect/actual trick previously...
# multiplatform
k
I've been using the expect/actual trick previously suggested in this channel to get
JvmName
to work in multiplatform code. i.e. declare a
actual typealias MyJvmName = kotlin.jvm.JvmName
and then annotate in the common project with
MyJvmName
. However, this trick doesnt seem to work for file level annotations, i.e.
typealias foo = kotlin.jvm.JvmName
and
@file:foo("MYFILE")
seems to be completely ignored (i still get
FileNameKt
classes generated), but
@file:JvmName("MYFILE")
works fine (but is only available in the jvm module). Is there a workaround for using
@file:JvmName
in a common module?