File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1920,7 +1920,7 @@ let add_with_bounds ~modality ~type_expr t =
1920
1920
~relevant_for_nullability: `Irrelevant ~type_expr ~modality t.jkind
1921
1921
}
1922
1922
1923
- let has_with_bounds t =
1923
+ let has_with_bounds ( type r ) ( t : (_ * r) jkind ) =
1924
1924
match t.jkind.with_bounds with
1925
1925
| No_with_bounds -> false
1926
1926
| With_bounds tys -> not (With_bounds_types. is_empty tys)
@@ -2932,7 +2932,10 @@ let round_up (type l r) ~jkind_of_type (t : (allowed * r) jkind) :
2932
2932
quality = Not_best (* As required by the fact that this is a [jkind_r] *)
2933
2933
}
2934
2934
2935
- let map_type_expr f t = { t with jkind = Jkind_desc. map_type_expr f t.jkind }
2935
+ let map_type_expr f t =
2936
+ if has_with_bounds t
2937
+ then { t with jkind = Jkind_desc. map_type_expr f t.jkind }
2938
+ else t (* short circuit this common case *)
2936
2939
2937
2940
(* this is hammered on; it must be fast! *)
2938
2941
let check_sub ~jkind_of_type sub super =
You can’t perform that action at this time.
0 commit comments