summaryrefslogtreecommitdiff
path: root/src/initial_check.ml
diff options
context:
space:
mode:
authorAlasdair2018-12-12 01:45:20 +0000
committerAlasdair2018-12-12 01:45:20 +0000
commitcdf287dfb69275e479d79ebc0d305e365dd3ee7b (patch)
tree636d211d4942db38cef1c0e09ac77683d28d1030 /src/initial_check.ml
parentc65aecd008d34102f4c95649113ed7f9afcc903b (diff)
Remove KOpt_none constructor
We should infer type variable kinds better in initial_check.ml, but we really don't want to have to deal with that everywhere, especially when we can no longer easily cheat and assume KOpt_none implies K_int.
Diffstat (limited to 'src/initial_check.ml')
-rw-r--r--src/initial_check.ml7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/initial_check.ml b/src/initial_check.ml
index da6c7b84..62f0dcf4 100644
--- a/src/initial_check.ml
+++ b/src/initial_check.ml
@@ -234,7 +234,7 @@ let to_ast_quant_item ctx (P.QI_aux (aux, l)) =
let aux, ctx = match aux with
| P.KOpt_none v ->
let v = to_ast_var v in
- KOpt_none v, { ctx with kinds = KBindings.add v K_int ctx.kinds }
+ KOpt_kind (K_aux (K_int, gen_loc kopt_l), v), { ctx with kinds = KBindings.add v K_int ctx.kinds }
| P.KOpt_kind (k, v) ->
let v = to_ast_var v in
let k = to_ast_kind k in
@@ -496,11 +496,6 @@ let to_ast_type_union ctx (P.Tu_aux (P.Tu_ty_id (atyp, id), l)) =
let typ = to_ast_typ ctx atyp in
Tu_aux (Tu_ty_id (typ, to_ast_id id), l)
-let kopt_kind (KOpt_aux (aux, l)) =
- match aux with
- | KOpt_none _ -> K_aux (K_int, gen_loc l)
- | KOpt_kind (k, _) -> k
-
let add_constructor id typq ctx =
let kinds = List.map (fun kopt -> unaux_kind (kopt_kind kopt)) (quant_kopts typq) in
{ ctx with type_constructors = Bindings.add id kinds ctx.type_constructors }