According to this documentation I can add the compiler arg -Xopt-in=kotlin.time.ExperimentalTime
and I don’t have to add the annotation all over my code.
I have a multiplatform project with js and jvm, and I’m still getting this error.
e: DataTransferTypes.kt: (54, 24): This declaration is experimental and its
usage must be marked with '@kotlin.time.ExperimentalTime' or
@OptIn(kotlin.time.ExperimentalTime::class)'
Despite the following in my gradle file. How do I pass that arg to the compile for common classes?
jvm {
compilations.all {
kotlinOptions {
…
freeCompilerArgs += listOf(
"-Xopt-in=kotlin.time.ExperimentalTime", …
)
}
}
…
}
js(IR) {
…
compilations.all {
kotlinOptions {
freeCompilerArgs += listOf(
"-Xopt-in=kotlin.time.ExperimentalTime", …
)
}
}
}