[nullsafe] Remove old traces of modelling the annotation for the field

Summary:
We historically had Model.Inference, which was an attempt to enhance
models with additional abilities to get the annotation.

This feature got removed in D9805110, including removing of the key
condition Models.Inference.field_is_marked.

This code also is not executed: `Config.eradicate` condition
was an old artefact of migrating Eradicate to callback infrastructure:
D1508451. We run eradicate only as a callback as of now, so this flag is
always true.

In follow up diffs we refactor AnnotationSignature module, and this
cleanup simplifies the refactoring.

Reviewed By: ngorogiannis

Differential Revision: D17419173

fbshipit-source-id: 1b30555de
master
Mitya Lyubarskiy 5 years ago committed by Facebook Github Bot
parent 21d3450ef5
commit 39aca6326c

@ -23,8 +23,5 @@ val mark_nullability : Typ.Procname.t -> t -> bool * bool list -> t
val get : ProcAttributes.t -> t
(** Get a method signature with annotations from a proc_attributes. *)
val mk_ia_nullable : Annot.Item.t -> Annot.Item.t
(** Add the nullable annotation to the item_annotation, if not already present. *)
val pp : Typ.Procname.t -> Format.formatter -> t -> unit
(** Pretty print a method signature with annotations. *)

@ -11,17 +11,7 @@ open! IStd
let get_field_annotation tenv fn typ =
let lookup = Tenv.lookup tenv in
match Typ.Struct.get_field_type_and_annotation ~lookup fn typ with
| None ->
None
| Some (t, ia) ->
let ia' =
(* TODO (t4968422) eliminate not !Config.eradicate check by marking fields as nullified *)
(* outside of Eradicate in some other way *)
if not Config.eradicate then AnnotatedSignature.mk_ia_nullable ia else ia
in
Some (t, ia')
Typ.Struct.get_field_type_and_annotation ~lookup fn typ
let report_error tenv = TypeErr.report_error tenv (EradicateCheckers.report_error tenv)

Loading…
Cancel
Save