diff options
| author | Thomas Bauereiss | 2017-07-20 17:38:44 +0100 |
|---|---|---|
| committer | Thomas Bauereiss | 2017-07-21 13:03:46 +0100 |
| commit | de99cb50d58423090b30976bdf4ac47dec0526d8 (patch) | |
| tree | a3a3e3ae62d96d82ade18f63e7943000235b72a6 /src/spec_analysis_new_tc.ml | |
| parent | 71a69fe43acd9fba7b5fb2279a2a7d601d265993 (diff) | |
Fix more corner cases
Diffstat (limited to 'src/spec_analysis_new_tc.ml')
| -rw-r--r-- | src/spec_analysis_new_tc.ml | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/spec_analysis_new_tc.ml b/src/spec_analysis_new_tc.ml index 777990aa..10eb16f7 100644 --- a/src/spec_analysis_new_tc.ml +++ b/src/spec_analysis_new_tc.ml @@ -448,7 +448,9 @@ let fv_of_tannot_opt consider_var (Typ_annot_opt_aux (t,_)) = | Typ_annot_opt_some (typq,typ) -> let bindings = if consider_var then typq_bindings typq else mt in let free = fv_of_typ consider_var bindings mt typ in - (bindings,free) + (bindings,free) + | Typ_annot_opt_none -> + (mt, mt) (*Unlike the other fv, the bound returns are the names bound by the pattern for use in the exp*) let fv_of_funcl consider_var base_bounds (FCL_aux(FCL_Funcl(id,pat,exp),l)) = @@ -467,7 +469,9 @@ let fv_of_fun consider_var (FD_aux (FD_function(rec_opt,tannot_opt,_,funcls),_)) | Typ_annot_opt_aux(Typ_annot_opt_some (typq, typ),_) -> let bindings = if consider_var then typq_bindings typq else mt in let bound = Nameset.union bindings base_bounds in - bound, fv_of_typ consider_var bound mt typ in + bound, fv_of_typ consider_var bound mt typ + | Typ_annot_opt_aux(Typ_annot_opt_none, _) -> + base_bounds, mt in let ns = List.fold_right (fun (FCL_aux(FCL_Funcl(_,pat,exp),_)) ns -> let pat_bs,pat_ns = pat_bindings consider_var base_bounds ns pat in let _, exp_ns,_ = fv_of_exp consider_var pat_bs pat_ns Nameset.empty exp in @@ -497,7 +501,9 @@ let rec fv_of_scattered consider_var consider_scatter_as_one all_defs (SD_aux(sd let b,ns = (match tannot_opt with | Typ_annot_opt_aux(Typ_annot_opt_some (typq, typ),_) -> let bindings = if consider_var then typq_bindings typq else mt in - bindings, fv_of_typ consider_var bindings mt typ) in + bindings, fv_of_typ consider_var bindings mt typ + | Typ_annot_opt_aux(Typ_annot_opt_none, _) -> + mt, mt) in init_env (string_of_id id),ns | SD_scattered_funcl (FCL_aux(FCL_Funcl(id,pat,exp),_)) -> let pat_bs,pat_ns = pat_bindings consider_var mt mt pat in |
