@@ -72,6 +72,17 @@ module Tools_error = struct
72
72
(* Could not find the module in the environment *)
73
73
| `Parent of parent_lookup_error ]
74
74
75
+ and simple_datatype_lookup_error =
76
+ [ `LocalDataType of
77
+ Env. t * Ident. path_datatype
78
+ (* Internal error: Found local path during lookup *)
79
+ | `Find_failure
80
+ (* Internal error: the type was not found in the parent signature *)
81
+ | `Lookup_failureT of
82
+ Identifier.Path.Type. t
83
+ (* Could not find the module in the environment *)
84
+ | `Parent of parent_lookup_error ]
85
+
75
86
and simple_value_lookup_error =
76
87
[ `LocalValue of
77
88
Env. t * Ident. path_value
@@ -83,6 +94,17 @@ module Tools_error = struct
83
94
(* Could not find the module in the environment *)
84
95
| `Parent of parent_lookup_error ]
85
96
97
+ and simple_constructor_lookup_error =
98
+ [ `LocalConstructor of
99
+ Env. t * Ident. constructor
100
+ (* Internal error: Found local path during lookup *)
101
+ | `Find_failure
102
+ (* Internal error: the type was not found in the parent signature *)
103
+ | `Lookup_failureC of
104
+ Identifier.Path.Constructor. t
105
+ (* Could not find the module in the environment *)
106
+ | `ParentC of simple_datatype_lookup_error ]
107
+
86
108
and parent_lookup_error =
87
109
[ `Parent_sig of
88
110
expansion_of_module_error
@@ -110,6 +132,8 @@ module Tools_error = struct
110
132
type any =
111
133
[ simple_type_lookup_error
112
134
| simple_value_lookup_error
135
+ | simple_constructor_lookup_error
136
+ | simple_datatype_lookup_error
113
137
| simple_module_type_lookup_error
114
138
| simple_module_type_expr_of_module_error
115
139
| simple_module_lookup_error
@@ -147,6 +171,10 @@ module Tools_error = struct
147
171
| `LocalMT (_ , id ) -> Format. fprintf fmt " Local id found: %a" Ident. fmt id
148
172
| `Local (_ , id ) -> Format. fprintf fmt " Local id found: %a" Ident. fmt id
149
173
| `LocalType (_ , id ) -> Format. fprintf fmt " Local id found: %a" Ident. fmt id
174
+ | `LocalDataType (_ , id ) ->
175
+ Format. fprintf fmt " Local id found: %a" Ident. fmt id
176
+ | `LocalConstructor (_ , id ) ->
177
+ Format. fprintf fmt " Local id found: %a" Ident. fmt id
150
178
| `LocalValue (_ , id ) ->
151
179
Format. fprintf fmt " Local id found: %a" Ident. fmt id
152
180
| `Find_failure -> Format. fprintf fmt " Find failure"
@@ -168,9 +196,14 @@ module Tools_error = struct
168
196
Format. fprintf fmt " Lookup failure (value): %a"
169
197
Component.Fmt. model_identifier
170
198
(m :> Odoc_model.Paths.Identifier.t )
199
+ | `Lookup_failureC m ->
200
+ Format. fprintf fmt " Lookup failure (value): %a"
201
+ Component.Fmt. model_identifier
202
+ (m :> Odoc_model.Paths.Identifier.t )
171
203
| `ApplyNotFunctor -> Format. fprintf fmt " Apply module is not a functor"
172
204
| `Class_replaced -> Format. fprintf fmt " Class replaced"
173
205
| `Parent p -> pp fmt (p :> any )
206
+ | `ParentC p -> pp fmt (p :> any )
174
207
| `UnexpandedTypeOf t ->
175
208
Format. fprintf fmt " Unexpanded `module type of` expression: %a"
176
209
Component.Fmt. module_type_type_of_desc t
@@ -206,7 +239,9 @@ let is_unexpanded_module_type_of =
206
239
| `Find_failure -> false
207
240
| `Lookup_failure _ -> false
208
241
| `Lookup_failure_root _ -> false
242
+ | `Lookup_failureC _ -> false
209
243
| `Parent p -> inner (p :> any )
244
+ | `ParentC p -> inner (p :> any )
210
245
| `Parent_sig p -> inner (p :> any )
211
246
| `Parent_module_type p -> inner (p :> any )
212
247
| `Parent_expr p -> inner (p :> any )
@@ -224,6 +259,8 @@ let is_unexpanded_module_type_of =
224
259
| `Lookup_failureT _ -> false
225
260
| `Lookup_failureV _ -> false
226
261
| `LocalType _ -> false
262
+ | `LocalDataType _ -> false
263
+ | `LocalConstructor _ -> false
227
264
| `LocalValue _ -> false
228
265
| `Class_replaced -> false
229
266
| `OpaqueClass -> false
@@ -298,6 +335,7 @@ type what =
298
335
| `Module of Identifier.Module .t
299
336
| `Module_type of Identifier.Signature .t
300
337
| `Module_path of Cpath .module_
338
+ | `Constructor_path of Cpath .constructor
301
339
| `Module_type_path of Cpath .module_type
302
340
| `Module_type_U of Component.ModuleType .U .expr
303
341
| `Include of Component.Include .decl
@@ -350,6 +388,7 @@ let report ~(what : what) ?tools_error action =
350
388
| `Type cfrag -> r " type" type_fragment cfrag
351
389
| `Type_path path -> r " type" type_path path
352
390
| `Value_path path -> r " value" value_path path
391
+ | `Constructor_path path -> r " constructor" constructor_path path
353
392
| `Class_type_path path -> r " class_type" class_type_path path
354
393
| `With_module frag -> r " module substitution" module_fragment frag
355
394
| `With_module_type frag ->
0 commit comments