Is there a way to globally enable contracts in Kot...
# announcements
s
Is there a way to globally enable contracts in Kotlin 1.3? Per module or even throughout the entire project. It's a little tedious to add the
@ExperimentalContracts
annotation absolutely everywhere. Thanks! :D Not entirely sure where to ask for this. If it's suitable for another channel, I'd be happy to move the question over there.
👍 1
d
You can use CLI flags
-Xexperimental=<annotation FQN>
and
-Xuse-experimental=<annotation FQN>
, which are module-wide equivalents of
@ExperimentalContracts
and
@UseExperimental(...)
https://github.com/Kotlin/KEEP/blob/master/proposals/experimental.md#propagation-and-opt-in-for-whole-modules
s
Fab! That's totally what I was looking for. Works like a charm. Thanks, @dsavvinov!
d
You're welcome ;)