summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKathy Gray2014-05-20 15:31:12 +0100
committerKathy Gray2014-05-20 15:31:12 +0100
commita7154183a2487cdf96b981e1daef192ce878fbc8 (patch)
tree110d4eded77420540e631cc0bdaf070a445c4538 /src
parent0fc4488f471f701cf0f5b20899da89dcd79b618f (diff)
Turn off annoying printf
Answer some apparent questions in the pretty printer (tagged with AAA after an XXX)
Diffstat (limited to 'src')
-rw-r--r--src/pretty_print.ml10
-rw-r--r--src/type_check.ml2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/pretty_print.ml b/src/pretty_print.ml
index d37aeab9..04d18f85 100644
--- a/src/pretty_print.ml
+++ b/src/pretty_print.ml
@@ -775,14 +775,17 @@ let doc_exp, doc_let =
| E_internal_cast((_,NoTyp),e) -> atomic_exp e
| E_internal_cast((_,Base((_,t),_,_,_)), (E_aux(_,(_,eannot)) as e)) ->
(match t.t,eannot with
- (* XXX I don't understand why we can hide the internal cast here *)
+ (* XXX I don't understand why we can hide the internal cast here
+ AAA Because an internal cast between vectors is only generated to reset the base access;
+ the type checker generates far more than are needed and they're pruned off here, after constraint resolution *)
| Tapp("vector",[TA_nexp n1;_;_;_]),Base((_,{t=Tapp("vector",[TA_nexp n2;_;_;_])}),_,_,_)
when nexp_eq n1 n2 -> atomic_exp e
| _ -> prefix 2 1 (parens (doc_typ (t_to_typ t))) (group (atomic_exp e)))
| E_tuple exps ->
parens (separate_map comma exp exps)
| E_record(FES_aux(FES_Fexps(fexps,_),_)) ->
- (* XXX E_record is not handled by parser currently *)
+ (* XXX E_record is not handled by parser currently
+ AAA I don't think the parser can handle E_record due to ambiguity with blocks; initial_check looks for blocks that are all field assignments and converts *)
braces (separate_map semi_sp doc_fexp fexps)
| E_record_update(e,(FES_aux(FES_Fexps(fexps,_),_))) ->
braces (doc_op (string "with") (exp e) (separate_map semi_sp doc_fexp fexps))
@@ -830,7 +833,8 @@ let doc_exp, doc_let =
| E_app_infix(l,op,r) ->
failwith ("unexpected app_infix operator " ^ (pp_format_id op))
(* doc_op (doc_id op) (exp l) (exp r) *)
- (* XXX missing case *)
+ (* XXX missing case
+ AAA internal_cast should never have an overload, if it's been seen it's a bug *)
| E_internal_cast ((_, Overload (_, _)), _) | E_internal_exp _ -> assert false
and let_exp (LB_aux(lb,_)) = match lb with
diff --git a/src/type_check.ml b/src/type_check.ml
index 5499c3e2..3c22a134 100644
--- a/src/type_check.ml
+++ b/src/type_check.ml
@@ -547,7 +547,7 @@ let rec check_exp envs expect_t (E_aux(e,(l,annot)) : tannot exp) : (tannot exp
(match (select_overload_variant d_env variants arg_t) with
| NoTyp -> typ_error l ("No matching function found with name " ^ i ^ " that expects parameters " ^ (t_to_string arg_t))
| Base((params,t),tag,cs,ef) ->
- let _ = Printf.eprintf "Selected an overloaded function for %s, variant with function type %s\n" i (t_to_string t) in
+ (*let _ = Printf.eprintf "Selected an overloaded function for %s, variant with function type %s\n" i (t_to_string t) in*)
(match t.t with
| Tfn(arg,ret,ef') ->
(match arg.t,arg_t.t with