From 94dafac93beaa5d4bb05e1b02cfcda2f65d1e891 Mon Sep 17 00:00:00 2001 From: Jacques Garrigue Date: Wed, 31 Oct 2012 23:53:28 +0000 Subject: keep longident in Typecore.Wrong_name git-svn-id: http://caml.inria.fr/svn/ocaml/branches/record-disambiguation@13056 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- typing/typecore.ml | 12 ++++++------ typing/typecore.mli | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'typing') diff --git a/typing/typecore.ml b/typing/typecore.ml index 5156889727..016c421fb0 100644 --- a/typing/typecore.ml +++ b/typing/typecore.ml @@ -33,7 +33,7 @@ type error = | Label_multiply_defined of Longident.t | Label_missing of Ident.t list | Label_not_mutable of Longident.t - | Wrong_name of string * Path.t * string + | Wrong_name of string * Path.t * Longident.t | Incomplete_format of string | Bad_conversion of string * int * char | Undefined_method of type_expr * string @@ -621,8 +621,7 @@ end) = struct if not pr then warn_pr (); lbl with Not_found -> - raise (Error (lid.loc, Wrong_name - (type_kind, tpath, Longident.last lid.txt))) + raise (Error (lid.loc, Wrong_name (type_kind, tpath, lid.txt))) end module Label = NameChoice (struct @@ -3388,9 +3387,10 @@ let report_error ppf = function print_labels labels | Label_not_mutable lid -> fprintf ppf "The record field %a is not mutable" longident lid - | Wrong_name (kind, p, s) -> - fprintf ppf "The %s type %a has no %s %s" kind path p - (if kind = "record" then "field" else "constructor") s + | Wrong_name (kind, p, lid) -> + fprintf ppf "The %s type %a has no %s %a" kind path p + (if kind = "record" then "label" else "constructor") + longident lid | Incomplete_format s -> fprintf ppf "Premature end of format string ``%S''" s | Bad_conversion (fmt, i, c) -> diff --git a/typing/typecore.mli b/typing/typecore.mli index ef33a60b00..df40cff6d9 100644 --- a/typing/typecore.mli +++ b/typing/typecore.mli @@ -75,7 +75,7 @@ type error = | Label_multiply_defined of Longident.t | Label_missing of Ident.t list | Label_not_mutable of Longident.t - | Wrong_name of string * Path.t * string + | Wrong_name of string * Path.t * Longident.t | Incomplete_format of string | Bad_conversion of string * int * char | Undefined_method of type_expr * string -- cgit v1.2.1