Commit 6187368c authored by Julien Lopez's avatar Julien Lopez
Browse files

[TESTS][LAMBDA] Fix on types in branches of abstraction

parent 17335b8d
......@@ -151,9 +151,10 @@ and parse_abstr env l loc fun_name iface fv body =
let l = (match fun_name with
| None -> l
| Some (id, name) -> Locals.add name (id,fun_typ) l) in
(* Apparently, CDuce never uses btype (union of types of patterns) *)
let b, btype = parse_branches env l ptype [] Types.empty body in
let brs = { Typed.br_typ=btype; br_accept=accept_type btype;
br_branches=b } in
let t = type_of_ptype ptype in
let brs = { Typed.br_typ=t; br_accept=accept_type t; br_branches=b } in
let abstr = { Typed.fun_name=fun_name; fun_iface=iface; fun_body=brs;
fun_typ=fun_typ; fun_fv=fv } in
env, l, { Typed.exp_loc=caml_loc_to_cduce loc; exp_typ=fun_typ;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment