Feature Request P2
Status Update
Comments
em...@google.com <em...@google.com> #2
Some things to work out before making the annotations type-use:
- Determine guidelines for type nullability in public API
- Determine rules for when type nullability can change in public API
- Confirm that intellij nullability lint works as expected for type-use nullability annotations
- Test what the impact would be on existing arrays (due to ambiguities of type-use annotations on arrays)
- Confirm usage of type-use
androidx.annotation.NonNull/Nullable
in metalava won't break anything for platform
Description
Sealed classes and interfaces cannot be extended directly outside their module. Intuitively this implies they are effectively final, and therefore otherwise incompatible changes would be allowed, such as adding a new abstract method.
Unfortunately, it's possible to extend a sealed class with an abstract class as below and inadvertently expose a new abstract method (
funFromSealed()
in the example below). We should figure out how we want to model this behavior in Metalava, figure out if there's any other considerations to sealed classes, and then maybe updateClassItem.isEffectivelyFinal()
to match.