How bad is it to use `@OptIn(ExperimentalContracts...
# library-development
m
How bad is it to use
@OptIn(ExperimentalContracts::class)
in a library? Looks like
contracts {}
blocks do not generate any bytecode (besides metadata?) so as long as it's only used internally it should be fine?
j
it is used by stdlib in all places, I guess the only problem is you will have to refactor the implementation when they finish the contracts API (if it changed)
🙏 1
👌 1
b
Yeah, the KEEP says contracts are pretty much binary stable: • Syntax for declaring contracts (i.e. Contracts DSL) is unstable at the moment, and it's possible that it will be completely changed in the future. ◦ It means that writing your own contracts isn't suited for production usage yet • Binary representation (in Kotlin Metadata) is stable enough and actually is a part of stdlib already. It won't be changed without a graceful migration cycle. ◦ It means that you can depend on binary artifacts with contracts (e.g. stdlib) with all usual compatibility guarantees • Semantics, as usual, may be changed only in exceptional circumstances and only after graceful migration cycle ◦ It means that you can rely on the analysis made with the help of contracts, as it won't get broken suddenly
🙏 1
m
Nice, thanks !!
😁 1