From cdf287dfb69275e479d79ebc0d305e365dd3ee7b Mon Sep 17 00:00:00 2001 From: Alasdair Date: Wed, 12 Dec 2018 01:45:20 +0000 Subject: 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. --- src/initial_check.ml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/initial_check.ml') 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 } -- cgit v1.2.3