diff options
| author | Alasdair | 2018-12-08 01:06:28 +0000 |
|---|---|---|
| committer | Alasdair | 2018-12-08 02:48:04 +0000 |
| commit | d8f0854ca9d80d3af8d6a4aaec778643eda9421c (patch) | |
| tree | d7d64ccbc3e972ceae549080f62c0c036452c6a6 /src/spec_analysis.ml | |
| parent | 2c25110ad2f5e636239ba65a2154aae79ffa253c (diff) | |
Compiling again
Change Typ_arg_ to A_. We use it a lot more now typ_arg is used instead of
uvar as the result of unify. Plus A_ could either stand for argument, or
Any/A type which is quite appropriate in most use cases.
Restore instantiation info in infer_funapp'. Ideally we would save this
instead of recomputing it ever time we need it. However I checked and
there are over 300 places in the code that would need to be changed to add
an extra argument to E_app. Still some issues causing specialisation to
fail however.
Improve the error message when we swap how we infer/check an l-expression,
as this could previously cause the actual cause of a type-checking failure
to be effectively hidden.
Diffstat (limited to 'src/spec_analysis.ml')
| -rw-r--r-- | src/spec_analysis.ml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/spec_analysis.ml b/src/spec_analysis.ml index 84fa8235..2ab64f1c 100644 --- a/src/spec_analysis.ml +++ b/src/spec_analysis.ml @@ -101,7 +101,7 @@ and free_type_names_maybe_t consider_var = function | Some t -> free_type_names_t consider_var t | None -> mt and free_type_names_t_arg consider_var = function - | Typ_arg_aux (Typ_arg_typ t, _) -> free_type_names_t consider_var t + | A_aux (A_typ t, _) -> free_type_names_t consider_var t | _ -> mt and free_type_names_t_args consider_var targs = nameset_bigunion (List.map (free_type_names_t_arg consider_var) targs) @@ -129,9 +129,9 @@ let rec fv_of_typ consider_var bound used (Typ_aux (t,l)) : Nameset.t = | 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' | Typ_internal_unknown -> unreachable l __POS__ "escaped Typ_internal_unknown" -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 - | Typ_arg_nexp n -> fv_of_nexp consider_var bound used n +and fv_of_targ consider_var bound used (Ast.A_aux(targ,_)) : Nameset.t = match targ with + | A_typ t -> fv_of_typ consider_var bound used t + | A_nexp n -> fv_of_nexp consider_var bound used n | _ -> used and fv_of_nexp consider_var bound used (Ast.Nexp_aux(n,_)) = match n with @@ -309,7 +309,7 @@ let fv_of_kind_def consider_var (KD_aux(k,_)) = match k with | KD_nabbrev(_,id,_,nexp) -> init_env (string_of_id id), fv_of_nexp consider_var mt mt nexp let fv_of_type_def consider_var (TD_aux(t,_)) = match t with - | TD_abbrev(id,typq,Typ_arg_aux(Typ_arg_typ typ, l)) -> + | TD_abbrev(id,typq,A_aux(A_typ typ, l)) -> let typschm = TypSchm_aux (TypSchm_ts (typq,typ), l) in init_env (string_of_id id), snd (fv_of_typschm consider_var mt mt typschm) | TD_record(id,_,typq,tids,_) -> |
