Skip to content

Commit d862a37

Browse files
committed
Remove more explicit uses of function$.
1 parent be7ea6e commit d862a37

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

compiler/ml/includemod.ml

+3-14
Original file line numberDiff line numberDiff line change
@@ -504,23 +504,12 @@ let show_locs ppf (loc1, loc2) =
504504
show_loc "Expected declaration" ppf loc2;
505505
show_loc "Actual declaration" ppf loc1
506506

507-
let include_err ~env ppf = function
507+
let include_err ppf = function
508508
| Missing_field (id, loc, kind) ->
509509
fprintf ppf "The %s `%a' is required but not provided" kind ident id;
510510
show_loc "Expected declaration" ppf loc
511511
| Value_descriptions (id, d1, d2) ->
512-
let curry_kind_1, curry_kind_2 =
513-
match
514-
(Ctype.expand_head env d1.val_type, Ctype.expand_head env d2.val_type)
515-
with
516-
| {desc = Tarrow _}, {desc = Tconstr (Pident {name = "function$"}, _, _)}
517-
->
518-
(" (curried)", " (uncurried)")
519-
| {desc = Tconstr (Pident {name = "function$"}, _, _)}, {desc = Tarrow _}
520-
->
521-
(" (uncurried)", " (curried)")
522-
| _ -> ("", "")
523-
in
512+
let curry_kind_1, curry_kind_2 = ("", "") in
524513
fprintf ppf
525514
"@[<hv 2>Values do not match:@ %a%s@;<1 -2>is not included in@ %a%s@]"
526515
(value_description id) d1 curry_kind_1 (value_description id) d2
@@ -606,7 +595,7 @@ let context ppf cxt =
606595

607596
let include_err ppf (cxt, env, err) =
608597
Printtyp.wrap_printing_env env (fun () ->
609-
fprintf ppf "@[<v>%a%a@]" context (List.rev cxt) (include_err ~env) err)
598+
fprintf ppf "@[<v>%a%a@]" context (List.rev cxt) include_err err)
610599

611600
let buffer = ref Bytes.empty
612601
let is_big obj =

compiler/ml/typecore.ml

+4-8
Original file line numberDiff line numberDiff line change
@@ -4458,18 +4458,14 @@ let report_error env ppf error =
44584458
| Some valid_methods -> spellcheck ppf me valid_methods)
44594459
| Not_subtype (tr1, tr2) ->
44604460
report_subtyping_error ppf env tr1 "is not a subtype of" tr2
4461-
| Too_many_arguments (in_function, ty) -> (
4461+
| Too_many_arguments (in_function, ty) ->
44624462
if (* modified *)
44634463
in_function then (
44644464
fprintf ppf "@[This function expects too many arguments,@ ";
44654465
fprintf ppf "it should have type@ %a@]" type_expr ty)
4466-
else
4467-
match ty with
4468-
| {desc = Tconstr (Pident {name = "function$"}, _, _)} ->
4469-
fprintf ppf "This expression is expected to have an uncurried function"
4470-
| _ ->
4471-
fprintf ppf "@[This expression should not be a function,@ ";
4472-
fprintf ppf "the expected type is@ %a@]" type_expr ty)
4466+
else (
4467+
fprintf ppf "@[This expression should not be a function,@ ";
4468+
fprintf ppf "the expected type is@ %a@]" type_expr ty)
44734469
| Abstract_wrong_label (l, ty) ->
44744470
let label_mark = function
44754471
| Nolabel -> "but its first argument is not labelled"

0 commit comments

Comments
 (0)