diff options
| author | Alasdair Armstrong | 2017-08-15 18:12:43 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2017-08-15 18:12:43 +0100 |
| commit | 3a61ca53dd501b501bcc6e076aac11243c38880a (patch) | |
| tree | 06edab74973ad832170900d123654098ad3641cb /src/spec_analysis.ml | |
| parent | 727bb4b7a13815620226a49647bc7c54a0812597 (diff) | |
| parent | 637ed6dcd3831fb831ab30f7ed1dc00226a8fa7c (diff) | |
Merge remote-tracking branch 'origin/mono-experiments' into experiments
Diffstat (limited to 'src/spec_analysis.ml')
| -rw-r--r-- | src/spec_analysis.ml | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/spec_analysis.ml b/src/spec_analysis.ml index 1475da7a..5281ef27 100644 --- a/src/spec_analysis.ml +++ b/src/spec_analysis.ml @@ -211,6 +211,7 @@ let rec free_type_names_t consider_var (Typ_aux (t, _)) = match t with | Typ_tup ts -> free_type_names_ts consider_var ts | Typ_app (name,targs) -> Nameset.add (string_of_id name) (free_type_names_t_args consider_var targs) | Typ_wild -> mt + | Typ_exist (kids,_,t') -> List.fold_left (fun s kid -> Nameset.remove (string_of_kid kid) s) (free_type_names_t consider_var t') kids and free_type_names_ts consider_var ts = nameset_bigunion (List.map (free_type_names_t consider_var) ts) and free_type_names_maybe_t consider_var = function | Some t -> free_type_names_t consider_var t @@ -239,6 +240,7 @@ let rec fv_of_typ consider_var bound used (Typ_aux (t,_)) : Nameset.t = | Typ_tup ts -> List.fold_right (fun t n -> fv_of_typ consider_var bound n t) ts used | Typ_app(id,targs) -> List.fold_right (fun ta n -> fv_of_targ consider_var bound n ta) targs (conditional_add_typ bound used id) + | Typ_exist (kids,_,t') -> fv_of_typ consider_var (List.fold_left (fun b (Kid_aux (Var v,_)) -> Nameset.add v b) bound kids) used t' and fv_of_targ consider_var bound used (Ast.Typ_arg_aux(targ,_)) : Nameset.t = match targ with | Typ_arg_typ t -> fv_of_typ consider_var bound used t |
