@ -39,18 +39,16 @@ let pp fmt typestate =
let map_join m1 m2 =
let range_join _ exp range1_opt range2_opt =
Option . both range1_opt range2_opt
| > Option . map
~ f : ( fun ( ( ( typ1 , inferred_nullability1 ) as range1 ) , ( _ , inferred_nullability2 ) ) ->
InferredNullability . join inferred_nullability1 inferred_nullability2
| > Option . value_map ~ default : range1 ~ f : ( fun ta' ->
( (* Java does not support local type inference ( for codebases and Java version nullsafe is currently aimed for ) .
The real type does not depend on types being joined ; it is determined by the corresponding type declaration instead .
We don't really use type information for reasons not related to things like diagnostic , and using one of types
serves as a good proxy .
Let's take the left one .
* )
typ1
, ta' ) ) )
| > Option . map ~ f : ( fun ( ( typ1 , inferred_nullability1 ) , ( _ , inferred_nullability2 ) ) ->
(* Unlike nullability that Nullsafe infers, Java does not support local type inference
( for codebases and Java version nullsafe is currently aimed for ) .
The real type does not depend on types being joined ; it is determined by the corresponding type declaration instead .
We don't really use type information for reasons not related to things like diagnostic , and using one of types
serves as a good proxy .
Let's take the left one .
* )
let joined_type = typ1 in
( joined_type , InferredNullability . join inferred_nullability1 inferred_nullability2 ) )
in
if phys_equal m1 m2 then m1 else M . merge range_join m1 m2