summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlasdair Armstrong2019-11-11 17:00:24 +0000
committerAlasdair Armstrong2019-11-11 17:00:24 +0000
commitcd49c9df8e1d688327ae045729b538df00b77622 (patch)
treec44354bb5ee44c165e9ac6e69795d1ae96c58a3f /src
parent20df613aee16ab0a1610bd9507c55d4fe48a43f3 (diff)
Make sure undefined_gen inserts enough type annotations for union constructors
Diffstat (limited to 'src')
-rw-r--r--src/initial_check.ml4
-rw-r--r--src/jib/c_backend.ml2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/initial_check.ml b/src/initial_check.ml
index 1aebdbc2..7012e915 100644
--- a/src/initial_check.ml
+++ b/src/initial_check.ml
@@ -931,8 +931,8 @@ let generate_undefineds vs_ids (Defs defs) =
in
let undefined_tu = function
| Tu_aux (Tu_ty_id (Typ_aux (Typ_tup typs, _), id), _) ->
- mk_exp (E_app (id, List.map (fun _ -> mk_lit_exp L_undef) typs))
- | Tu_aux (Tu_ty_id (typ, id), _) -> mk_exp (E_app (id, [mk_lit_exp L_undef]))
+ mk_exp (E_app (id, List.map (fun typ -> mk_exp (E_cast (typ, mk_lit_exp L_undef))) typs))
+ | Tu_aux (Tu_ty_id (typ, id), _) -> mk_exp (E_app (id, [mk_exp (E_cast (typ, mk_lit_exp L_undef))]))
in
let p_tup = function
| [pat] -> pat
diff --git a/src/jib/c_backend.ml b/src/jib/c_backend.ml
index fc0259e9..1fcfe551 100644
--- a/src/jib/c_backend.ml
+++ b/src/jib/c_backend.ml
@@ -2029,7 +2029,7 @@ let codegen_def' ctx = function
| None ->
c_error ~loc:(id_loc id) ("No valspec found for " ^ string_of_id id)
in
-
+
(* Check that the function has the correct arity at this point. *)
if List.length arg_ctyps <> List.length args then
c_error ~loc:(id_loc id) ("function arguments "