Skip to content

Commit 86f02aa

Browse files
committed
Cleanup: remove Ptyp_class and Ttyp_class.
1 parent 2649c2b commit 86f02aa

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

0 commit comments

Comments
 (0)