Skip to content

Commit a05622d

Browse files
committed
Cleanup: remove Ptyp_class and Ttyp_class.
1 parent c0f3e43 commit a05622d

20 files changed

+1
-21
lines changed

compiler/frontend/bs_ast_mapper.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ module T = struct
107107
constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
108108
| Ptyp_object (l, o) ->
109109
object_ ~loc ~attrs (List.map (object_field sub) l) o
110-
| Ptyp_class () -> assert false
111110
| Ptyp_alias (t, s) -> alias ~loc ~attrs (sub.typ sub t) s
112111
| Ptyp_variant (rl, b, ll) ->
113112
variant ~loc ~attrs (List.map (row_field sub) rl) b ll

compiler/gentype/TranslateCoreType.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ and translateCoreType_ ~config ~type_vars_gen
269269
type_;
270270
}
271271
| None -> {dependencies = []; type_ = unknown})
272-
| Ttyp_any | Ttyp_class _ -> {dependencies = []; type_ = unknown}
272+
| Ttyp_any -> {dependencies = []; type_ = unknown}
273273

274274
and translateCoreTypes_ ~config ~type_vars_gen ~type_env type_exprs :
275275
translation list =

compiler/ml/ast_helper.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ module Typ = struct
9090
| Ptyp_constr (longident, lst) ->
9191
Ptyp_constr (longident, List.map loop lst)
9292
| Ptyp_object (lst, o) -> Ptyp_object (List.map loop_object_field lst, o)
93-
| Ptyp_class () -> assert false
9493
| Ptyp_alias (core_type, string) ->
9594
check_variable var_names t.ptyp_loc string;
9695
Ptyp_alias (loop core_type, string)

compiler/ml/ast_iterator.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ module T = struct
104104
iter_loc sub lid;
105105
List.iter (sub.typ sub) tl
106106
| Ptyp_object (ol, _o) -> List.iter (object_field sub) ol
107-
| Ptyp_class () -> ()
108107
| Ptyp_alias (t, _) -> sub.typ sub t
109108
| Ptyp_variant (rl, _b, _ll) -> List.iter (row_field sub) rl
110109
| Ptyp_poly (_, t) -> sub.typ sub t

compiler/ml/ast_mapper.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ module T = struct
9999
constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
100100
| Ptyp_object (l, o) ->
101101
object_ ~loc ~attrs (List.map (object_field sub) l) o
102-
| Ptyp_class () -> assert false
103102
| Ptyp_alias (t, s) -> alias ~loc ~attrs (sub.typ sub t) s
104103
| Ptyp_variant (rl, b, ll) ->
105104
variant ~loc ~attrs (List.map (row_field sub) rl) b ll

compiler/ml/depend.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ let rec add_type bv ty =
118118
| Otag (_, _, t) -> add_type bv t
119119
| Oinherit t -> add_type bv t)
120120
fl
121-
| Ptyp_class () -> ()
122121
| Ptyp_alias (t, _) -> add_type bv t
123122
| Ptyp_variant (fl, _, _) ->
124123
List.iter

compiler/ml/parsetree.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ and core_type_desc =
9595
(* < l1:T1; ...; ln:Tn > (flag = Closed)
9696
< l1:T1; ...; ln:Tn; .. > (flag = Open)
9797
*)
98-
| Ptyp_class of unit (* dummy AST node *)
9998
| Ptyp_alias of core_type * string (* T as 'a *)
10099
| Ptyp_variant of row_field list * closed_flag * label list option
101100
(* [ `A|`B ] (flag = Closed; labels = None)
@@ -652,7 +651,6 @@ module Legacy = struct
652651
| Ptyp_constr (lid, tl) -> Ptyp_constr (lid, List.map core_type tl)
653652
| Ptyp_object (fields, closed) ->
654653
Ptyp_object (List.map object_field fields, closed)
655-
| Ptyp_class () -> Ptyp_class ()
656654
| Ptyp_alias (t, lid) -> Ptyp_alias (core_type t, lid)
657655
| Ptyp_variant (row_fields, closed, labels) ->
658656
Ptyp_variant (List.map row_field row_fields, closed, labels)

compiler/ml/pprintast.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ and core_type1 ctxt f x =
321321
in
322322
pp f "@[<hov2><@ %a%a@ > @]" (list core_field_type ~sep:";") l
323323
field_var o (* Cf #7200 *)
324-
| Ptyp_class () -> ()
325324
| Ptyp_package (lid, cstrs) ->
326325
let aux f (s, ct) =
327326
pp f "type %a@ =@ %a" longident_loc s (core_type ctxt) ct in

compiler/ml/printast.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ let rec core_type i ppf x =
150150
line i ppf "Oinherit\n";
151151
core_type (i + 1) ppf ct)
152152
l
153-
| Ptyp_class () -> ()
154153
| Ptyp_alias (ct, s) ->
155154
line i ppf "Ptyp_alias \"%s\"\n" s;
156155
core_type i ppf ct

compiler/ml/printtyped.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ let rec core_type i ppf x =
179179
line i ppf "OTinherit\n";
180180
core_type (i + 1) ppf ct)
181181
l
182-
| Ttyp_class () -> ()
183182
| Ttyp_alias (ct, s) ->
184183
line i ppf "Ttyp_alias \"%s\"\n" s;
185184
core_type i ppf ct

compiler/ml/tast_iterator.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ let typ sub {ctyp_desc; ctyp_env; _} =
303303
| Ttyp_tuple list -> List.iter (sub.typ sub) list
304304
| Ttyp_constr (_, _, list) -> List.iter (sub.typ sub) list
305305
| Ttyp_object (list, _) -> List.iter (sub.object_field sub) list
306-
| Ttyp_class () -> ()
307306
| Ttyp_alias (ct, _) -> sub.typ sub ct
308307
| Ttyp_variant (list, _, _) -> List.iter (sub.row_field sub) list
309308
| Ttyp_poly (_, ct) -> sub.typ sub ct

compiler/ml/tast_mapper.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ let typ sub x =
370370
Ttyp_constr (path, lid, List.map (sub.typ sub) list)
371371
| Ttyp_object (list, closed) ->
372372
Ttyp_object (List.map (sub.object_field sub) list, closed)
373-
| Ttyp_class () -> Ttyp_class ()
374373
| Ttyp_alias (ct, s) -> Ttyp_alias (sub.typ sub ct, s)
375374
| Ttyp_variant (list, closed, labels) ->
376375
Ttyp_variant (List.map (sub.row_field sub) list, closed, labels)

compiler/ml/typedecl.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ let is_fixed_type sd =
158158
let rec has_row_var sty =
159159
match sty.ptyp_desc with
160160
| Ptyp_alias (sty, _) -> has_row_var sty
161-
| Ptyp_class _
162161
| Ptyp_object (_, Open)
163162
| Ptyp_variant (_, Open, _)
164163
| Ptyp_variant (_, Closed, Some _) ->

compiler/ml/typedtree.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ and core_type_desc =
314314
| Ttyp_tuple of core_type list
315315
| Ttyp_constr of Path.t * Longident.t loc * core_type list
316316
| Ttyp_object of object_field list * closed_flag
317-
| Ttyp_class of unit (* dummy AST node *)
318317
| Ttyp_alias of core_type * string
319318
| Ttyp_variant of row_field list * closed_flag * label list option
320319
| Ttyp_poly of string list * core_type

compiler/ml/typedtree.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,6 @@ and core_type_desc =
420420
| Ttyp_tuple of core_type list
421421
| Ttyp_constr of Path.t * Longident.t loc * core_type list
422422
| Ttyp_object of object_field list * closed_flag
423-
| Ttyp_class of unit (* dummy AST node *)
424423
| Ttyp_alias of core_type * string
425424
| Ttyp_variant of row_field list * closed_flag * label list option
426425
| Ttyp_poly of string list * core_type

compiler/ml/typedtreeIter.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ end = struct
391391
| Ttyp_tuple list -> List.iter iter_core_type list
392392
| Ttyp_constr (_path, _, list) -> List.iter iter_core_type list
393393
| Ttyp_object (list, _o) -> List.iter iter_object_field list
394-
| Ttyp_class () -> ()
395394
| Ttyp_alias (ct, _s) -> iter_core_type ct
396395
| Ttyp_variant (list, _bool, _labels) -> List.iter iter_row_field list
397396
| Ttyp_poly (_list, ct) -> iter_core_type ct

compiler/ml/typetexp.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ and transl_type_aux env policy styp =
379379
| Ptyp_object (fields, o) ->
380380
let ty, fields = transl_fields env policy o fields in
381381
ctyp (Ttyp_object (fields, o)) (newobj ty)
382-
| Ptyp_class () -> assert false
383382
| Ptyp_alias (st, alias) ->
384383
let cty =
385384
try

compiler/ml/untypeast.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,6 @@ let core_type sub ct =
519519
Ptyp_constr (map_loc sub lid, List.map (sub.typ sub) list)
520520
| Ttyp_object (list, o) ->
521521
Ptyp_object (List.map (sub.object_field sub) list, o)
522-
| Ttyp_class () -> Ptyp_class ()
523522
| Ttyp_alias (ct, s) -> Ptyp_alias (sub.typ sub ct, s)
524523
| Ttyp_variant (list, bool, labels) ->
525524
Ptyp_variant (List.map (sub.row_field sub) list, bool, labels)

compiler/syntax/src/res_ast_debugger.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,6 @@ module SexpAst = struct
875875
closed_flag flag;
876876
Sexp.list (map_empty ~f:object_field fields);
877877
]
878-
| Ptyp_class () -> assert false
879878
| Ptyp_variant (fields, flag, opt_labels) ->
880879
Sexp.list
881880
[

compiler/syntax/src/res_printer.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1766,7 +1766,6 @@ and print_typ_expr ~(state : State.t) (typ_expr : Parsetree.core_type) cmt_tbl =
17661766
| Ptyp_package package_type ->
17671767
print_package_type ~state ~print_module_keyword_and_parens:true
17681768
package_type cmt_tbl
1769-
| Ptyp_class _ -> Doc.text "classes are not supported in types"
17701769
| Ptyp_variant (row_fields, closed_flag, labels_opt) ->
17711770
let force_break =
17721771
typ_expr.ptyp_loc.Location.loc_start.pos_lnum

0 commit comments

Comments
 (0)