@@ -3793,10 +3793,17 @@ let rec subtype_rec env trace t1 t2 cstrs =
3793
3793
try
3794
3794
let lst = subtype_list env trace tl1 tl2 cstrs in
3795
3795
if List. length lst = List. length cstrs then None
3796
- else Some [ (* TODO(subtype-errors) *) ]
3797
- with _ -> Some [ (* TODO(subtype-errors) *) ])
3796
+ else
3797
+ Some
3798
+ [ (* TODO(subtype-errors) Variant constructor inline record mismatch *) ]
3799
+ with _ ->
3800
+ Some
3801
+ [ (* TODO(subtype-errors) Variant constructor inline record mismatch *) ]
3802
+ )
3798
3803
| violations -> Some violations
3799
- else Some [ (* TODO(subtype-errors) *) ]
3804
+ else
3805
+ Some
3806
+ [ (* TODO(subtype-errors) Variant constructor representation mismatch*) ]
3800
3807
| ( {
3801
3808
Types. cd_args = Cstr_tuple tl1;
3802
3809
cd_attributes = c1_attributes;
@@ -3813,16 +3820,22 @@ let rec subtype_rec env trace t1 t2 cstrs =
3813
3820
try
3814
3821
let lst = subtype_list env trace tl1 tl2 cstrs in
3815
3822
if List. length lst = List. length cstrs then None
3816
- else Some [ (* TODO(subtype-errors) *) ]
3817
- with _ -> Some [ (* TODO(subtype-errors) *) ]
3818
- else Some [ (* TODO(subtype-errors) *) ]
3819
- | _ -> Some [ (* TODO(subtype-errors) *) ])
3823
+ else
3824
+ Some
3825
+ [ (* TODO(subtype-errors) Variant constructor tuple mismatch *) ]
3826
+ with _ ->
3827
+ Some
3828
+ [ (* TODO(subtype-errors) Variant constructor tuple mismatch *) ]
3829
+ else
3830
+ Some
3831
+ [ (* TODO(subtype-errors) Variant constructor tuple mismatch *) ]
3832
+ | _ ->
3833
+ Some [ (* TODO(subtype-errors) Variant other issue *) ])
3820
3834
in
3821
3835
if field_subtype_violations = [] then cstrs
3822
3836
else (trace, t1, t2, ! univar_pairs, None ) :: cstrs)
3823
3837
| ( (p1, _, {type_kind = Type_record (fields1, repr1)}),
3824
3838
(p2, _, {type_kind = Type_record (fields2, repr2)}) ) ->
3825
- (* TODO(subtype-errors) Record representation *)
3826
3839
let same_repr =
3827
3840
match (repr1, repr2) with
3828
3841
| Record_regular , Record_regular ->
@@ -3850,7 +3863,13 @@ let rec subtype_rec env trace t1 t2 cstrs =
3850
3863
}) )
3851
3864
:: cstrs
3852
3865
else subtype_list env trace tl1 tl2 cstrs
3853
- else (trace, t1, t2, ! univar_pairs, None ) :: cstrs
3866
+ else
3867
+ ( trace,
3868
+ t1,
3869
+ t2,
3870
+ ! univar_pairs,
3871
+ None (* TODO(subtype-errors) Record representation *) )
3872
+ :: cstrs
3854
3873
| (p1 , _ , {type_kind = tk1 } ), (p2 , _ , {type_kind = tk2 } ) ->
3855
3874
( trace,
3856
3875
t1,
@@ -3880,7 +3899,6 @@ let rec subtype_rec env trace t1 t2 cstrs =
3880
3899
when extract_concrete_typedecl_opt env t2
3881
3900
|> Variant_coercion. type_is_variant -> (
3882
3901
(* TODO(subtype-errors) Polyvariant to variant *)
3883
- (* TODO(subtype-errors) Add Variant to polyvariant while we're at it? *)
3884
3902
match extract_concrete_typedecl env t2 with
3885
3903
| _, _, {type_kind = Type_variant variant_constructors; type_attributes}
3886
3904
-> (
0 commit comments