summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2012-05-28 21:57:08 +0000
committerJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2012-05-28 21:57:08 +0000
commitc7873aa96ebe56d658933ee1b83698a5c2970f8e (patch)
treead629781dbfe7c9d4fe67afbe5fc583ecd25be9f
parentc46da52b5739222bb31be9f0b416900d1d25392c (diff)
Improve error message (and indentation)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12491 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--typing/typecore.ml11
1 files changed, 7 insertions, 4 deletions
diff --git a/typing/typecore.ml b/typing/typecore.ml
index 168922d44..4afb1ee17 100644
--- a/typing/typecore.ml
+++ b/typing/typecore.ml
@@ -2985,11 +2985,14 @@ let report_error ppf = function
reset_and_mark_loops typ;
begin match (repr typ).desc with
Tarrow _ ->
- fprintf ppf "This function is applied to too many arguments;@ ";
- fprintf ppf "maybe you forgot a `;'. The function has type @ %a" type_expr typ
+ fprintf ppf "@[<v>@[<2>This function has type@;<1 2>%a@]"
+ type_expr typ;
+ fprintf ppf "@ @[It is applied to too many arguments;@ %s@]@]"
+ "maybe you forgot a `;'."
| _ ->
- fprintf ppf
- "This expression is not a function; it cannot be applied.@ It has type@ %a" type_expr typ
+ fprintf ppf "@[<v>@[<2>This expression has type@ %a@]@ %s@]"
+ type_expr typ
+ "This is not a function; it cannot be applied."
end
| Apply_wrong_label (l, ty) ->
let print_label ppf = function