Skip to content

Commit

Permalink
make ModuleTypechecker use Typechecker.typecheck_let_mutable
Browse files Browse the repository at this point in the history
  • Loading branch information
gfngfn committed Sep 15, 2024
1 parent 65034a1 commit 2df5d20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/frontend/moduleTypechecker.ml
Original file line number Diff line number Diff line change
Expand Up @@ -765,14 +765,12 @@ and typecheck_binding (config : typecheck_config) (tyenv : Typeenv.t) (utbind :
in
return ([ Rec(recbindacc |> Alist.to_list) ], ssig)

| UTMutable((rng, varnm) as var, utastI) ->
let* (eI, tyI) = Typechecker.typecheck { pre with quantifiability = Unquantifiable; } tyenv utastI in
let evid = EvalVarID.fresh var in
let pty = TypeConv.lift_poly (rng, RefType(tyI)) in
| UTMutable(ident, utastI) ->
let* (varnm, pty_ref, evid, eI) = Typechecker.typecheck_let_mutable pre tyenv ident utastI in
let ssig =
let ventry =
{
val_type = pty;
val_type = pty_ref;
val_name = Some(evid);
val_stage = pre.stage;
}
Expand Down
2 changes: 2 additions & 0 deletions src/frontend/typechecker.mli
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ val typecheck_letrec : pre -> type_environment -> untyped_let_binding list -> ((

val typecheck_nonrec : always_polymorphic:bool -> pre -> type_environment -> untyped_let_binding -> (var_name * poly_type * EvalVarID.t * abstract_tree, type_error) result

val typecheck_let_mutable : pre -> type_environment -> var_name ranged -> untyped_abstract_tree -> (var_name * poly_type * EvalVarID.t * abstract_tree, type_error) result

val main : typecheck_config -> stage -> Typeenv.t -> untyped_abstract_tree -> (mono_type * abstract_tree, type_error) result

val are_unifiable : mono_type -> mono_type -> bool

0 comments on commit 2df5d20

Please sign in to comment.