Skip to content

Commit a0e1e78

Browse files
committed
refactor
1 parent 29d08cb commit a0e1e78

File tree

5 files changed

+12
-22
lines changed

5 files changed

+12
-22
lines changed

compiler/ml/ctype.ml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ open Btype
5353
*)
5454

5555
(**** Errors ****)
56+
type type_pairs = (type_expr * type_expr) list
5657

57-
exception Unify of (type_expr * type_expr) list
58+
exception Unify of type_pairs
5859

5960
exception Tags of label * label
6061

@@ -100,11 +101,7 @@ type subtype_context =
100101
issues: Record_coercion.record_field_subtype_violation list;
101102
}
102103

103-
exception
104-
Subtype of
105-
(type_expr * type_expr) list
106-
* (type_expr * type_expr) list
107-
* subtype_context option
104+
exception Subtype of type_pairs * type_pairs * subtype_context option
108105

109106
exception Cannot_expand
110107

@@ -113,7 +110,7 @@ exception Cannot_apply
113110
exception Recursive_abbrev
114111

115112
(* GADT: recursive abbrevs can appear as a result of local constraints *)
116-
exception Unification_recursive_abbrev of (type_expr * type_expr) list
113+
exception Unification_recursive_abbrev of type_pairs
117114

118115
(**** Type level management ****)
119116

compiler/ml/ctype.mli

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,14 @@ type subtype_context =
4949
issues: Record_coercion.record_field_subtype_violation list;
5050
}
5151

52-
exception Unify of (type_expr * type_expr) list
52+
type type_pairs = (type_expr * type_expr) list
53+
exception Unify of type_pairs
5354
exception Tags of label * label
54-
exception
55-
Subtype of
56-
(type_expr * type_expr) list
57-
* (type_expr * type_expr) list
58-
* subtype_context option
55+
exception Subtype of type_pairs * type_pairs * subtype_context option
5956
exception Cannot_expand
6057
exception Cannot_apply
6158
exception Recursive_abbrev
62-
exception Unification_recursive_abbrev of (type_expr * type_expr) list
59+
exception Unification_recursive_abbrev of type_pairs
6360

6461
val init_def : int -> unit
6562
(* Set the initial variable level *)

compiler/ml/printtyp.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ val super_report_unification_error :
9494
val report_subtyping_error :
9595
formatter ->
9696
Env.t ->
97-
(type_expr * type_expr) list ->
97+
Ctype.type_pairs ->
9898
string ->
99-
(type_expr * type_expr) list ->
99+
Ctype.type_pairs ->
100100
Ctype.subtype_context option ->
101101
unit
102102
val report_ambiguous_type_error :

compiler/ml/typecore.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ type error =
5151
| Private_type of type_expr
5252
| Private_label of Longident.t * type_expr
5353
| Not_subtype of
54-
(type_expr * type_expr) list
55-
* (type_expr * type_expr) list
56-
* Ctype.subtype_context option
54+
Ctype.type_pairs * Ctype.type_pairs * Ctype.subtype_context option
5755
| Too_many_arguments of bool * type_expr
5856
| Abstract_wrong_label of Noloc.arg_label * type_expr
5957
| Scoping_let_module of string * type_expr

compiler/ml/typecore.mli

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ type error =
7676
| Private_type of type_expr
7777
| Private_label of Longident.t * type_expr
7878
| Not_subtype of
79-
(type_expr * type_expr) list
80-
* (type_expr * type_expr) list
81-
* Ctype.subtype_context option
79+
Ctype.type_pairs * Ctype.type_pairs * Ctype.subtype_context option
8280
| Too_many_arguments of bool * type_expr
8381
| Abstract_wrong_label of Noloc.arg_label * type_expr
8482
| Scoping_let_module of string * type_expr

0 commit comments

Comments
 (0)