Skip to content

Commit 3ec3860

Browse files
committed
revert change; add comment.
1 parent 4d4eade commit 3ec3860

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ocaml/typing/mode.ml

+7-2
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,10 @@ module Monadic = struct
13391339
let uniqueness m =
13401340
S.Negative.via_monotone Uniqueness.Obj.obj (Proj (Obj.obj, Uniqueness)) m
13411341

1342+
(* The monadic fragment is inverted. Most of the inversion logic is taken care
1343+
by [Solver_polarized], but some remain, such as the [Min_with] below which
1344+
is inverted from [Max_with]. *)
1345+
13421346
let max_with_uniqueness m =
13431347
S.Negative.via_monotone Obj.obj (Min_with Uniqueness)
13441348
(S.Negative.disallow_left m)
@@ -1368,8 +1372,9 @@ module Monadic = struct
13681372
match submode m0 m1 with
13691373
| Ok () -> Ok ()
13701374
| Error { left = uni0, (); right = uni1, () } ->
1371-
assert (not (Uniqueness.Const.le uni0 uni1));
1372-
Error (`Uniqueness { left = uni0; right = uni1 })
1375+
if Uniqueness.Const.le uni0 uni1
1376+
then assert false
1377+
else Error (`Uniqueness { left = uni0; right = uni1 })
13731378

13741379
(* override to report the offending axis *)
13751380
let equate = equate_from_submode submode

0 commit comments

Comments
 (0)