@@ -533,28 +533,22 @@ let show_locs ppf (loc1, loc2) =
533
533
show_loc " Expected declaration" ppf loc2;
534
534
show_loc " Actual declaration" ppf loc1
535
535
536
- let include_err ppf = function
536
+ let include_err ~ env ppf = function
537
537
| Missing_field (id , loc , kind ) ->
538
538
fprintf ppf " The %s `%a' is required but not provided" kind ident id;
539
539
show_loc " Expected declaration" ppf loc
540
- | Value_descriptions (id,
541
- ({ val_type = { desc = Tlink { desc = Tconstr (Pident {name = " function$" },_,_) }}} as d1),
542
- ({ val_type = { desc = Tarrow _ }} as d2)) ->
543
- fprintf ppf
544
- " @[<hv 2>Values do not match:@ %a (uncurried)@;<1 -2>is not included in@ %a (curried)@]"
545
- (value_description id) d1 (value_description id) d2;
546
- show_locs ppf (d1.val_loc, d2.val_loc)
547
- | Value_descriptions (id,
548
- ({ val_type = { desc = Tlink { desc = Tarrow _ }}} as d1),
549
- ({ val_type = { desc = Tconstr (Pident {name = " function$" },_,_)}} as d2)) ->
550
- fprintf ppf
551
- " @[<hv 2>Values do not match:@ %a (curried)@;<1 -2>is not included in@ %a (uncurried)@]"
552
- (value_description id) d1 (value_description id) d2;
553
- show_locs ppf (d1.val_loc, d2.val_loc)
554
540
| Value_descriptions (id , d1 , d2 ) ->
541
+ let curry_kind_1, curry_kind_2 =
542
+ match (Ctype. expand_head env d1.val_type, Ctype. expand_head env d2.val_type ) with
543
+ | { desc = Tarrow _ },
544
+ { desc = Tconstr (Pident {name = " function$" },_,_)} -> (" (curried)" , " (uncurried)" )
545
+ | { desc = Tconstr (Pident {name = " function$" },_,_)},
546
+ { desc = Tarrow _ } -> (" (uncurried)" , " (curried)" )
547
+ | _ -> (" " , " " )
548
+ in
555
549
fprintf ppf
556
- " @[<hv 2>Values do not match:@ %a@;<1 -2>is not included in@ %a@]"
557
- (value_description id) d1 (value_description id) d2;
550
+ " @[<hv 2>Values do not match:@ %a%s @;<1 -2>is not included in@ %a%s @]"
551
+ (value_description id) d1 curry_kind_1 (value_description id) d2 curry_kind_2 ;
558
552
show_locs ppf (d1.val_loc, d2.val_loc);
559
553
| Type_declarations (id , d1 , d2 , errs ) ->
560
554
fprintf ppf " @[<v>@[<hv>%s:@;<1 2>%a@ %s@;<1 2>%a@]%a%a@]"
@@ -647,7 +641,7 @@ let context ppf cxt =
647
641
648
642
let include_err ppf (cxt , env , err ) =
649
643
Printtyp. wrap_printing_env env (fun () ->
650
- fprintf ppf " @[<v>%a%a@]" context (List. rev cxt) include_err err)
644
+ fprintf ppf " @[<v>%a%a@]" context (List. rev cxt) ( include_err ~env ) err)
651
645
652
646
let buffer = ref Bytes. empty
653
647
let is_big obj =
0 commit comments