Module Nullsafe__AnnotatedNullability
type t
=
|
Nullable of nullable_origin
|
ProvisionallyNullable of Nullsafe.ProvisionalAnnotation.t
Exist only for specical run modes
|
ThirdPartyNonnull
|
UncheckedNonnull of unchecked_nonnull_origin
|
LocallyTrustedNonnull
|
LocallyCheckedNonnull
|
StrictNonnull of strict_nonnull_origin
See
Nullability
.t for explanation
and nullable_origin
=
and unchecked_nonnull_origin
=
and strict_nonnull_origin
=
val compare : t -> t -> int
val compare_nullable_origin : nullable_origin -> nullable_origin -> int
val compare_unchecked_nonnull_origin : unchecked_nonnull_origin -> unchecked_nonnull_origin -> int
val compare_strict_nonnull_origin : strict_nonnull_origin -> strict_nonnull_origin -> int
val compare : t -> t -> int
val compare_nullable_origin : nullable_origin -> nullable_origin -> int
val compare_unchecked_nonnull_origin : unchecked_nonnull_origin -> unchecked_nonnull_origin -> int
val compare_strict_nonnull_origin : strict_nonnull_origin -> strict_nonnull_origin -> int
val compare : t -> t -> int
val compare_nullable_origin : nullable_origin -> nullable_origin -> int
val compare_unchecked_nonnull_origin : unchecked_nonnull_origin -> unchecked_nonnull_origin -> int
val compare_strict_nonnull_origin : strict_nonnull_origin -> strict_nonnull_origin -> int
val get_nullability : t -> Nullsafe.Nullability.t
val of_type_and_annotation : is_callee_in_trust_list:bool -> nullsafe_mode:Nullsafe.NullsafeMode.t -> is_third_party:bool -> IR.Typ.t -> IR.Annot.Item.t -> t
Given 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_list
defines 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 -> bool
A method for the special mode where imaginary (provisional)
@Nullable
annotations 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
@Nullable
in 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