Annotation Type ParametricNullness


  • @Retention(RUNTIME)
    @Target({FIELD,METHOD,PARAMETER})
    @TypeQualifierNickname
    @Nonnull(when=UNKNOWN)
    @interface ParametricNullness
    Marks a "top-level" type-variable usage as (a) a Kotlin platform type when the type argument is non-nullable and (b) nullable when the type argument is nullable. This is the closest we can get to "non-nullable when non-nullable; nullable when nullable" (like the Android NullFromTypeParam). We use this to "undo" ElementTypesAreNonnullByDefault.