@@ -6,15 +6,13 @@ module SN = Naming_special_names
66
77type tparam_bounds = TySet .t [@@ deriving hash , show ]
88
9- (* TODO(T222659258) remove parameters field here *)
109type kind = {
1110 lower_bounds : tparam_bounds ;
1211 upper_bounds : tparam_bounds ;
1312 reified : Aast .reify_kind ;
1413 enforceable : bool ;
1514 newable : bool ;
1615 require_dynamic : bool ;
17- parameters : named_kind list ;
1816 rank : int ;
1917}
2018
@@ -24,47 +22,18 @@ let dummy_name = (Pos_or_decl.none, "")
2422
2523let with_dummy_name k = (dummy_name, k)
2624
27- let get_arity k = List. length k.parameters
28-
29- let string_of_kind (kind : kind ) =
30- let rec stringify toplevel k =
31- match k.parameters with
32- | [] -> " Type"
33- | params ->
34- let parts = List. map params ~f: (fun (_ , pk ) -> stringify false pk) in
35- let res = String. concat ~sep: " -> " parts ^ " -> Type" in
36- if toplevel then
37- res
38- else
39- " (" ^ res ^ " )"
40- in
41- stringify true kind
42-
43- let description_of_kind kind =
44- match kind.parameters with
45- | [] -> " a fully-applied type"
46- | params
47- when List. for_all params ~f: (fun (_ , param ) ->
48- Int. ( = ) 0 (get_arity param)) ->
49- (* no higher-order arguments *)
50- let param_count = List. length params in
51- let args_desc =
52- if Int. ( = ) 1 param_count then
53- " a single (fully-applied) type argument"
54- else
55- string_of_int param_count ^ " (fully-applied) type arguments"
56- in
57- " a type constructor expecting " ^ args_desc
58- | _ -> " a type constructor of kind " ^ string_of_kind kind
25+ let get_arity _k =
26+ (* TODO(T222659258) Always 0 now that higher-kinded types are being removed *)
27+ 0
5928
60- let rec remove_bounds kind =
61- {
62- kind with
63- lower_bounds = TySet. empty;
64- upper_bounds = TySet. empty;
65- parameters =
66- List. map kind.parameters ~f: ( fun ( n , k ) -> (n, remove_bounds k));
67- }
29+ let string_of_kind ( _kind : kind) =
30+ (* TODO(T222659258) Find and remove users of this *) " Type "
31+
32+ let description_of_kind _kind =
33+ (* TODO(T222659258) Find and remove users of this *) " a fully-applied type "
34+
35+ let remove_bounds kind =
36+ { kind with lower_bounds = TySet. empty; upper_bounds = TySet. empty }
6837
6938module Simple = struct
7039 type bounds_for_wildcard =
@@ -101,7 +70,6 @@ module Simple = struct
10170 enforceable;
10271 newable;
10372 require_dynamic = false ;
104- parameters = [] ;
10573 rank = 0 ;
10674 },
10775 NonLocalized [] )
@@ -122,16 +90,7 @@ module Simple = struct
12290 Attributes. mem SN.UserAttributes. uaNewable tp_user_attributes
12391 in
12492 let (st, _) = fully_applied_type ~reified ~enforceable ~newable () in
125- ( tp_name,
126- {
127- st with
128- parameters = named_internal_kinds_of_decl_tparams decl_tparam.tp_tparams;
129- } )
130-
131- (* not public *)
132- and named_internal_kinds_of_decl_tparams (tparams : decl_tparam list ) :
133- named_full_kind list =
134- List. map tparams ~f: named_internal_kind_of_decl_tparam
93+ (tp_name, st)
13594
13695 (* public *)
13796 and named_kind_of_decl_tparam decl_tparam : named_kind =
@@ -144,14 +103,12 @@ module Simple = struct
144103 let named_kinds_of_decl_tparams decl_tparams : named_kind list =
145104 List. map decl_tparams ~f: named_kind_of_decl_tparam
146105
147- let type_with_params_to_simple_kind ?reified ?enforceable ?newable tparams =
106+ let type_with_params_to_simple_kind ?reified ?enforceable ?newable _tparams =
148107 let (st, _) = fully_applied_type ?reified ?enforceable ?newable () in
149- ( { st with parameters = named_internal_kinds_of_decl_tparams tparams },
150- NonLocalized [] )
108+ (st, NonLocalized [] )
151109
152110 (* * Returns the type parameters of the kind, more or less. *)
153- let get_named_parameter_kinds (kind , _ ) : named_kind list =
154- List. map kind.parameters ~f: (fun (n , fk ) -> (n, (fk, NonLocalized [] )))
111+ let get_named_parameter_kinds (_kind , _ ) : named_kind list = []
155112
156113 let from_full_kind fk =
157114 let wildcard_bounds =
@@ -165,15 +122,14 @@ module Simple = struct
165122 let with_dummy_name = with_dummy_name
166123end
167124
168- let rec force_lazy_values (kind : kind ) =
125+ let force_lazy_values (kind : kind ) =
169126 let {
170127 lower_bounds;
171128 upper_bounds;
172129 reified;
173130 enforceable;
174131 newable;
175132 require_dynamic;
176- parameters;
177133 rank;
178134 } =
179135 kind
@@ -185,9 +141,5 @@ let rec force_lazy_values (kind : kind) =
185141 enforceable;
186142 newable;
187143 require_dynamic;
188- parameters = List. map parameters ~f: force_lazy_values_named_kind;
189144 rank;
190145 }
191-
192- and force_lazy_values_named_kind ((p , kind ) : named_kind ) =
193- (p, force_lazy_values kind)
0 commit comments