Skip to content

Commit

Permalink
Make equal take an lr
Browse files Browse the repository at this point in the history
  • Loading branch information
goldfirere committed Sep 27, 2024
1 parent a6a21d8 commit 234abce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ocaml/typing/ctype.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3264,7 +3264,8 @@ let add_jkind_equation ~reason uenv destination jkind1 =
begin
try
let decl = Env.find_type p env in
if not (Jkind.equal jkind decl.type_jkind)
if not (Jkind.equal (Jkind.terrible_relax_l jkind)
(Jkind.terrible_relax_l decl.type_jkind))
then
let refined_decl = { decl with type_jkind = jkind } in
set_env uenv (Env.add_local_constraint p refined_decl env);
Expand Down
6 changes: 4 additions & 2 deletions ocaml/typing/jkind.mli
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ type jkind_l := Types.jkind_l

type jkind_r := Types.jkind_r

type jkind_lr := Types.jkind_lr

type packed = Pack : 'd t -> packed [@@unboxed]

include Allowance.Allow_disallow with type (_, _, 'd) sided = 'd t
Expand Down Expand Up @@ -454,14 +456,14 @@ val set_printtyp_path : (Format.formatter -> Path.t -> unit) -> unit
(** This checks for equality, and sets any variables to make two jkinds
equal, if possible. e.g. [equate] on a var and [value] will set the
variable to be [value] *)
val equate : 'd t -> 'd t -> bool
val equate : jkind_lr -> jkind_lr -> bool

(** This checks for equality, but has the invariant that it can only be called
when there is no need for unification; e.g. [equal] on a var and [value]
will crash.
CR layouts (v1.5): At the moment, this is actually the same as [equate]! *)
val equal : 'd t -> 'd t -> bool
val equal : jkind_lr -> jkind_lr -> bool

(** Checks whether two jkinds have a non-empty intersection. Might mutate
sort variables. *)
Expand Down

0 comments on commit 234abce

Please sign in to comment.