Commit a2efc762 authored by Kim Nguyễn's avatar Kim Nguyễn
Browse files

Remove commented code in clean_type. Restore cleaning of variables that are in...

Remove commented code in clean_type. Restore cleaning of variables that are in covariant position in the result type, to avoid having strange types such as: [] -> [ ('b) * ]
parent 89a5e61c
......@@ -2804,7 +2804,7 @@ module Positive = struct
let () = Memo.add memo (pos,v) () in
match v.def with
|`Type d -> ()
|`Variable d when Var.Set.mem d delta || not (Var.is_internal d) -> Hashtbl.replace vars d v
|`Variable d when Var.Set.mem d delta || (not (Var.is_internal d) && not pos) -> Hashtbl.replace vars d v
|`Variable d ->
begin try
let td = Hashtbl.find vars d in
......@@ -2840,22 +2840,6 @@ module Positive = struct
let clean_type delta t =
if no_var t then t else
clean_variables delta t
(*let arrow_t, non_arrow_t =
{ empty with arrow = t.arrow },
{ t with arrow = empty.arrow }
in
let _, u_arrow = Arrow.get arrow_t in
let res = List.fold_left (fun acc i_arrow ->
T.cup acc (
let conj_arrow =
List.fold_left (fun acc (dom, cdom) ->
let indiv_arrow = T.arrow (T.cons dom) (T.cons cdom) in
DescrSList.add indiv_arrow acc
) DescrSList.empty i_arrow
in
DescrSList.fold (T.cap) T.any conj_arrow
)
) non_arrow_t u_arrow *)
end
......
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