@@ -20,34 +20,37 @@ open Types
20
20
21
21
type subtype_context =
22
22
| Generic of {errorCode : string }
23
+ (* * A generic subtype error, intended to be extended to be handled later. *)
23
24
| Primitive_coercion_target_variant_not_unboxed of {
24
25
variant_name : Path .t ;
25
26
primitive : Path .t ;
26
- }
27
+ } (* * Coercing a primitive to a variant that is not unboxed. *)
27
28
| Primitive_coercion_target_variant_no_catch_all of {
28
29
variant_name : Path .t ;
29
30
primitive : Path .t ;
30
31
}
32
+ (* * Coercing a primitive to a variant that does not have a catch-all case. *)
31
33
| Variant_constructor_runtime_representation_mismatch of {
32
34
variant_name : Path .t ;
33
35
issues : Variant_coercion .variant_runtime_representation_issue list ;
34
36
}
37
+ (* * A variant constructor's runtime representation does not match the target variant. *)
35
38
| Variant_configurations_mismatch of {
36
39
left_variant_name : Path .t ;
37
40
right_variant_name : Path .t ;
38
41
issue : Variant_coercion .variant_configuration_issue ;
39
- }
42
+ } (* * Variants are configured differently. *)
40
43
| Different_type_kinds of {
41
44
left_typename : Path .t ;
42
45
right_typename : Path .t ;
43
46
left_type_kind : type_kind ;
44
47
right_type_kind : type_kind ;
45
- }
48
+ } (* * The types are of different kinds. *)
46
49
| Record_fields_mismatch of {
47
50
left_record_name : Path .t ;
48
51
right_record_name : Path .t ;
49
52
issues : Record_coercion .record_field_subtype_violation list ;
50
- }
53
+ } (* * Records have fields that are not compatible. *)
51
54
52
55
type type_pairs = (type_expr * type_expr ) list
53
56
exception Unify of type_pairs
0 commit comments