@@ -3561,19 +3561,13 @@ and type_expect_
3561
3561
in
3562
3562
end_def () ;
3563
3563
unify_var env (newvar() ) funct.exp_type;
3564
- let exp =
3565
- { exp_desc = Texp_apply (funct, args, position);
3566
- exp_loc = loc; exp_extra = [] ;
3567
- exp_type = ty_res;
3568
- exp_mode = expected_mode.mode;
3569
- exp_attributes = sexp.pexp_attributes;
3570
- exp_env = env } in
3571
- begin
3572
- try rue exp
3573
- with Error (_ , _ , Expr_type_clash _ ) as err ->
3574
- Misc. reraise_preserving_backtrace err (fun () ->
3575
- check_partial_application false exp)
3576
- end
3564
+ rue {
3565
+ exp_desc = Texp_apply (funct, args, position);
3566
+ exp_loc = loc; exp_extra = [] ;
3567
+ exp_type = ty_res;
3568
+ exp_mode = expected_mode.mode;
3569
+ exp_attributes = sexp.pexp_attributes;
3570
+ exp_env = env }
3577
3571
| Pexp_match (sarg , caselist ) ->
3578
3572
let arg_pat_mode, arg_expected_mode =
3579
3573
match cases_tuple_arity caselist with
@@ -6354,9 +6348,27 @@ let report_literal_type_constraint const = function
6354
6348
report_literal_type_constraint typ const
6355
6349
| Some _ | None -> []
6356
6350
6351
+ let report_partial_application = function
6352
+ | Some tr -> begin
6353
+ let ty =
6354
+ match tr.Unification_trace. got.Unification_trace. expanded with
6355
+ | None -> tr.Unification_trace. got.Unification_trace. t
6356
+ | Some ty -> ty
6357
+ in
6358
+ let ty = repr ty in
6359
+ match ty.desc with
6360
+ | Tarrow _ ->
6361
+ [ Location. msg
6362
+ " @[Hint: This function application is partial,@ \
6363
+ maybe some arguments are missing.@]" ]
6364
+ | _ -> []
6365
+ end
6366
+ | None -> []
6367
+
6357
6368
let report_expr_type_clash_hints exp diff =
6358
6369
match exp with
6359
6370
| Some (Texp_constant const ) -> report_literal_type_constraint const diff
6371
+ | Some (Texp_apply _ ) -> report_partial_application diff
6360
6372
| _ -> []
6361
6373
6362
6374
let report_pattern_type_clash_hints
0 commit comments