Skip to content

Commit

Permalink
Replace assertion with a match statement (ocaml-flambda#1225)
Browse files Browse the repository at this point in the history
  • Loading branch information
poechsel authored Mar 17, 2023
1 parent 0045bb7 commit 3e5fce6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ocaml/typing/types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,11 @@ let get_id t = (repr t).id
module Transient_expr = struct
let create desc ~level ~scope ~id = {desc; level; scope; id}
let set_desc ty d = ty.desc <- d
let set_stub_desc ty d = assert (ty.desc = Tvar None); ty.desc <- d
let set_stub_desc ty d =
(match ty.desc with
| Tvar None -> ()
| _ -> assert false);
ty.desc <- d
let set_level ty lv = ty.level <- lv
let set_scope ty sc = ty.scope <- sc
let coerce ty = ty
Expand Down

0 comments on commit 3e5fce6

Please sign in to comment.