diff options
| author | Alasdair Armstrong | 2017-08-10 23:24:59 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2017-08-10 23:24:59 +0100 |
| commit | 588c45e84642425fe9530f4ef6a44753cc54a0f8 (patch) | |
| tree | 7f02b3bd6bc9d24194162843d587baaca8a9fadb /src | |
| parent | e4fce3ffd02b69e36b42ffe3c868570c45aef986 (diff) | |
Fix bug with subtyping in let bindings
Diffstat (limited to 'src')
| -rw-r--r-- | src/type_check.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/type_check.ml b/src/type_check.ml index 5e9ff5f1..cc222ac7 100644 --- a/src/type_check.ml +++ b/src/type_check.ml @@ -1743,7 +1743,7 @@ let rec check_exp env (E_aux (exp_aux, (l, ())) as exp : unit exp) (Typ_aux (typ | LB_val_explicit (typschm, pat, bind) -> assert false | LB_val_implicit (P_aux (P_typ (ptyp, _), _) as pat, bind) -> let checked_bind = crule check_exp env bind ptyp in - let tpat, env = bind_pat env pat (typ_of checked_bind) in + let tpat, env = bind_pat env pat ptyp in annot_exp (E_let (LB_aux (LB_val_implicit (tpat, checked_bind), (let_loc, None)), crule check_exp env exp typ)) typ | LB_val_implicit (pat, bind) -> let inferred_bind = irule infer_exp env bind in @@ -1870,7 +1870,7 @@ and type_coercion_unify env (E_aux (_, (l, _)) as annotated_exp) typ = end and bind_pat env (P_aux (pat_aux, (l, ())) as pat) (Typ_aux (typ_aux, _) as typ) = - typ_print ("Binding " ^ string_of_typ typ); + typ_print ("Binding " ^ string_of_pat pat ^ " to " ^ string_of_typ typ); let annot_pat pat typ = P_aux (pat, (l, Some (env, typ, no_effect))) in let switch_typ (P_aux (pat_aux, (l, Some (env, _, eff)))) typ = P_aux (pat_aux, (l, Some (env, typ, eff))) in let bind_tuple_pat (tpats, env) pat typ = |
