summaryrefslogtreecommitdiff
path: root/typing
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2012-10-31 23:53:28 +0000
committerJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2012-10-31 23:53:28 +0000
commit94dafac93beaa5d4bb05e1b02cfcda2f65d1e891 (patch)
tree9f1b2130665a7d81a142a4bcf34ce798df3258de /typing
parent4e92b813c17cc1055e9a1a1d79251f89c0112870 (diff)
downloadocaml-94dafac93beaa5d4bb05e1b02cfcda2f65d1e891.tar.gz
keep longident in Typecore.Wrong_name
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/record-disambiguation@13056 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'typing')
-rw-r--r--typing/typecore.ml12
-rw-r--r--typing/typecore.mli2
2 files changed, 7 insertions, 7 deletions
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