Skip to content

Replace const_min/max with meet/join_with #2302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions ocaml/typing/ctype.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1584,8 +1584,8 @@ let prim_mode mvar = function
let with_locality locality m =
let m' = Alloc.newvar () in
Locality.equate_exn (Alloc.locality m') locality;
Alloc.submode_exn m' (Alloc.set_locality_max m);
Alloc.submode_exn (Alloc.set_locality_min m) m';
Alloc.submode_exn m' (Alloc.join_with_locality Locality.Const.max m);
Alloc.submode_exn (Alloc.meet_with_locality Locality.Const.min m) m';
m'

let rec instance_prim_locals locals mvar macc finalret ty =
Expand Down Expand Up @@ -5574,17 +5574,17 @@ let mode_cross_left env ty mode =
let mode = Alloc.disallow_right mode in
let mode =
if Locality.Const.le upper_bounds.locality Locality.Const.min
then Alloc.set_locality_min mode
then Alloc.meet_with_locality Locality.Const.min mode
else mode
in
let mode =
if Linearity.Const.le upper_bounds.linearity Linearity.Const.min
then Alloc.set_linearity_min mode
then Alloc.meet_with_linearity Linearity.Const.min mode
else mode
in
let mode =
if Uniqueness.Const.le upper_bounds.uniqueness Uniqueness.Const.min
then Alloc.set_uniqueness_min mode
then Alloc.meet_with_uniqueness Uniqueness.Const.min mode
else mode
in
mode
Expand All @@ -5600,17 +5600,17 @@ let mode_cross_right env ty mode =
let mode = Alloc.disallow_left mode in
let mode =
if Locality.Const.le upper_bounds.locality Locality.Const.min
then Alloc.set_locality_max mode
then Alloc.join_with_locality Locality.Const.max mode
else mode
in
let mode =
if Linearity.Const.le upper_bounds.linearity Linearity.Const.min
then Alloc.set_linearity_max mode
then Alloc.join_with_linearity Linearity.Const.max mode
else mode
in
let mode =
if Uniqueness.Const.le upper_bounds.uniqueness Uniqueness.Const.min
then Alloc.set_uniqueness_max mode
then Alloc.join_with_uniqueness Uniqueness.Const.max mode
else mode
in
mode
Expand Down
Loading