[nullsafe] Remove uneccessary logic in chosing join priority

Summary:
This was perhaps needed at some point, but now there is no need in this.

See the next diff that refactors InferredNullability so we store all
joinee results there.

Reviewed By: artempyanykh

Differential Revision: D24621413

fbshipit-source-id: d6f406b87
master
Mitya Lyubarskiy 4 years ago committed by Facebook GitHub Bot
parent 19d1d2a678
commit ffe1b55f42

@ -39,9 +39,9 @@ let join t1 t2 =
t2.origin
| false, false | true, true ->
(* Nullability is not fully determined by neither t1 nor t2
Let TypeOrigin logic to decide what to prefer in this case.
Picking the left one for stability
*)
TypeOrigin.join t1.origin t2.origin
t1.origin
in
{nullability= joined_nullability; origin= joined_origin}

@ -194,13 +194,3 @@ let get_description origin =
(* A technical origin *)
| OptimisticFallback ->
None
let join o1 o2 =
match (o1, o2) with
| Field _, (NullConst _ | NonnullConst _ | CurrMethodParameter _ | This | MethodCall _ | New) ->
(* low priority to Field, to support field initialization patterns *)
o2
| _ ->
(* left priority *)
o1

@ -52,8 +52,5 @@ val get_nullability : t -> Nullability.t
val get_description : t -> string option
(** Get a description to be used for error messages. *)
val join : t -> t -> t
(** Join with left priority *)
val to_string : t -> string
(** Raw string representation. *)

Loading…
Cancel
Save