From 3f26221cc9d2e8961a1199e351de0aba9e2ed960 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Mon, 5 Aug 2019 15:05:34 +0100 Subject: Remove escape/pure effect restriction for mapping --- src/type_check.ml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') 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, _), _) -> -- cgit v1.2.3