Commit 01e9ada9 authored by Kim Nguyễn's avatar Kim Nguyễn

Simplify (and fix) the code adding variables of a function interface to delta...

Simplify (and fix) the code adding variables of a function interface to delta during the typing of its body.
parent d7b41a1a
......@@ -977,21 +977,13 @@ and type_check' loc env ed constr precise = match ed with
in
(* update \delta with all variables in t1 -> t2 *)
let deltaintf =
let union (t1,t2) =
Var.Set.union
(Types.all_vars(t1))
(Types.all_vars(t2))
in
match a.fun_iface with
|[] -> Var.Set.empty
|head::tail ->
List.fold_left (fun acc intf ->
Var.Set.inter (union intf) acc
) (union head) tail
let delta_intf =
List.fold_left (fun acc (t1, t2) ->
Var.Set.(union acc (union (Types.all_vars t1) (Types.all_vars t2)))
) env.delta a.fun_iface
in
let env = {env with delta = Var.Set.union env.delta deltaintf } in
let env = {env with delta = delta_intf } in
(* I check the body with all possible t1 -> t2 types *)
let sll =
......
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