diff options
| author | Jon French | 2018-10-05 14:31:27 +0100 |
|---|---|---|
| committer | Jon French | 2018-10-05 14:32:42 +0100 |
| commit | 69d99cf8a3336e4c3a73b9d26cc3ddd4203cc517 (patch) | |
| tree | 544f4156635f6a7e35093bf78b1373e7b84212b7 | |
| parent | de7fda6c197fe2fdb265aa4ecfeafacaa6297a19 (diff) | |
fix bug in infer_mpat losing types of identifiers inferred from other_env
| -rw-r--r-- | src/type_check.ml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/type_check.ml b/src/type_check.ml index 765c41f9..565d1eed 100644 --- a/src/type_check.ml +++ b/src/type_check.ml @@ -3717,7 +3717,7 @@ and infer_mpat allow_unknown other_env env (MP_aux (mpat_aux, (l, ())) as mpat) match Env.lookup_id v env with | Local (Immutable, _) | Unbound -> begin match Env.lookup_id v other_env with - | Local (Immutable, typ) -> annot_mpat (MP_typ (annot_mpat (MP_id v) typ, typ)) typ, env, [] + | Local (Immutable, typ) -> bind_mpat allow_unknown other_env env (mk_mpat (MP_typ (mk_mpat (MP_id v), typ))) typ | Unbound -> if allow_unknown then annot_mpat (MP_id v) unknown_typ, env, [] else typ_error l ("Cannot infer identifier in mapping-pattern " ^ string_of_mpat mpat ^ " - try adding a type annotation") |
