You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some libraries outside of Jetbrains' are beginning to make use of Kotlin's opt-in mechanism. Clients have two options to deal with those:
Adding a @OptIn(my.opt.InClass::class) or equivalent annotation to classes using features guarded by an opt-in requirement, or
Passing -Xopt-in=my.opt.InClass to kotlinc.
While the first one works fine, it results in potentially lots of clutter if a codebase decides to opt-in a library like kotlinx-datetime. More importantly, it doesn't work for generated code.
This would be awesome to get. Two comments, which may be obvious already (apologies if so):
based on my understanding, the 'normal' use of the -Xopt-in flag is to pass it multiple times to the compiler, meaning that it's usually additive (you can decide to opt in to ExperimentalSerializationApi separately from the kotlin.OptIn annotation). Not sure if that changes anything in the implementation or how to use it in BUILD.bazel files.
Some libraries outside of Jetbrains' are beginning to make use of Kotlin's opt-in mechanism. Clients have two options to deal with those:
@OptIn(my.opt.InClass::class)
or equivalent annotation to classes using features guarded by an opt-in requirement, or-Xopt-in=my.opt.InClass
to kotlinc.While the first one works fine, it results in potentially lots of clutter if a codebase decides to opt-in a library like kotlinx-datetime. More importantly, it doesn't work for generated code.
From what I understand, the current implementation of
kt_kotlinc_options
(https://github.com/bazelbuild/rules_kotlin/blob/master/src/main/starlark/rkt_1_5/kotlin/opts.bzl) doesn't allow free text values for flags, so it's not as simple as adding ax_opt_in
entry there.The text was updated successfully, but these errors were encountered: