diff options
| author | Alasdair Armstrong | 2019-08-05 15:05:34 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2019-08-05 15:05:34 +0100 |
| commit | 3f26221cc9d2e8961a1199e351de0aba9e2ed960 (patch) | |
| tree | 78b63911cfbbd8975f41389b21531f478290fa49 /src | |
| parent | 8b1c4ce0c3659020e0f2a2e04d70798931dc9b63 (diff) | |
Remove escape/pure effect restriction for mapping
Diffstat (limited to 'src')
| -rw-r--r-- | src/type_check.ml | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/type_check.ml b/src/type_check.ml index 819143de..af4a7f65 100644 --- a/src/type_check.ml +++ b/src/type_check.ml @@ -4999,10 +4999,7 @@ let check_mapdef env (MD_aux (MD_mapping (id, tannot_opt, mapcls), (l, _)) as md let mapcls = List.map (fun mapcl -> check_mapcl mapcl_env mapcl typ) mapcls in let eff = List.fold_left union_effects no_effect (List.map mapcl_effect mapcls) in let env = Env.define_val_spec id env in - if equal_effects eff no_effect || equal_effects eff (mk_effect [BE_escape]) || !opt_no_effects then - vs_def @ [DEF_mapdef (MD_aux (MD_mapping (id, tannot_opt, mapcls), (l, None)))], env - else - typ_error env l ("Mapping not pure (or escape only): " ^ string_of_effect eff ^ " found") + vs_def @ [DEF_mapdef (MD_aux (MD_mapping (id, tannot_opt, mapcls), (l, None)))], env let rec warn_if_unsafe_cast l env = function | Typ_aux (Typ_fn (arg_typs, ret_typ, _), _) -> |
