| |
let generalizable tenv t0 =
let inenv = marker() in
let mark m t = (repr t).mark <- m in
let visit_asumption (x, (q, t)) =
let bound = marker() in
List.iter (mark bound) q; visit_type bound inenv ignore t in
List.iter visit_asumption tenv;
let ftv = ref [] in
let collect t = match desc t with Tvar _ -> ftv := t::!ftv | _ -> () in
let free = marker() in
visit_type inenv free collect t0;
!ftv;;
let x = tvar();;
generalizable [] (tarrow x x);; |
|