Module Nullsafe.AnnotatedNullability
type t=|Nullable of nullable_origin|ProvisionallyNullable of ProvisionalAnnotation.tExist only for specical run modes
|ThirdPartyNonnull|UncheckedNonnull of unchecked_nonnull_origin|LocallyTrustedNonnull|LocallyCheckedNonnull|StrictNonnull of strict_nonnull_originSee
Nullability.tfor explanation
and nullable_origin=and unchecked_nonnull_origin=and strict_nonnull_origin=
val compare : t -> t -> intval compare_nullable_origin : nullable_origin -> nullable_origin -> intval compare_unchecked_nonnull_origin : unchecked_nonnull_origin -> unchecked_nonnull_origin -> intval compare_strict_nonnull_origin : strict_nonnull_origin -> strict_nonnull_origin -> intval compare : t -> t -> intval compare_nullable_origin : nullable_origin -> nullable_origin -> intval compare_unchecked_nonnull_origin : unchecked_nonnull_origin -> unchecked_nonnull_origin -> intval compare_strict_nonnull_origin : strict_nonnull_origin -> strict_nonnull_origin -> intval compare : t -> t -> intval compare_nullable_origin : nullable_origin -> nullable_origin -> intval compare_unchecked_nonnull_origin : unchecked_nonnull_origin -> unchecked_nonnull_origin -> intval compare_strict_nonnull_origin : strict_nonnull_origin -> strict_nonnull_origin -> int
val get_nullability : t -> Nullability.tval of_type_and_annotation : is_callee_in_trust_list:bool -> nullsafe_mode:NullsafeMode.t -> is_third_party:bool -> IR.Typ.t -> IR.Annot.Item.t -> tGiven the type and its annotations, returns its nullability. NOTE: it does not take into account models etc., so this is intended to be used as a helper function for more high-level annotation processing.
is_callee_in_trust_listdefines whether the callee class is in the caller's explicitly provided trust list and therefore whether its nullability should be refined.
val can_be_considered_for_provisional_annotation : t -> boolA method for the special mode where imaginary (provisional)
@Nullableannotations are added to the code: see alsoProvisionalAnnotation.t. This is a helper method useful for preliminary filtration of types that:- can be semantically annotated as
@Nullablein the source code e.g. non-primitive types - makes logical sense to annotate - e.g. the source code is under control.
- can be semantically annotated as
val pp : Stdlib.Format.formatter -> t -> unit