<@UEJCGUJCA> Does the new stability inference feat...
# compose
z
@Leland Richardson [G] Does the new stability inference feature mean that the Stable/Immutable annotations can eventually be deprecated? Are there still cases that the inference misses that need to be explicitly annotated?
l
It means that their use should be drastically reduced, but I don’t think we will deprecate them any time soon
for one, a stable annotation on a class is a contract, whereas inferred stability is not
l
They could be replaced by
val class
if/when that becomes a thing?
l
if an interface is marked @Stable, it means that subclasses of it are expected (or, “required”) to be stable.
👍 1
l
val interface
? 🤔
l
val class
will certainly qualify for stability, but it is not a replacement. it just becomes another category of stable types
we also can’t expect the inference to be perfect. you will be able to write classes that have state but have a public API that can be considered stateful, but the compiler won’t be able to prove that
the goal here was to make this something that was “good enough” that most of the time you just don’t have to think about it anymore
z
Cool, that makes perfect sense
3