summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2013-10-01 11:40:21 +0000
committerAlain Frisch <alain@frisch.fr>2013-10-01 11:40:21 +0000
commit5554eb13e93aef36861b09901a450022733eb2f9 (patch)
tree54850c466762291b0c29e7da868698e6b7ea63b3
parent2d5bd020211be4104dec7c9e7792f458ffc101c8 (diff)
downloadocaml-5554eb13e93aef36861b09901a450022733eb2f9.tar.gz
Fix #6193 (Incorrect warning 12 for character ranges).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14205 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--typing/typecore.ml8
1 files changed, 5 insertions, 3 deletions
diff --git a/typing/typecore.ml b/typing/typecore.ml
index fee74fd6ba..2649430e82 100644
--- a/typing/typecore.ml
+++ b/typing/typecore.ml
@@ -968,14 +968,16 @@ let rec type_pat ~constrs ~labels ~no_existentials ~mode ~env sp expected_ty =
pat_env = !env }
| Ppat_interval (Const_char c1, Const_char c2) ->
let open Ast_helper.Pat in
+ let gloc = {loc with Location.loc_ghost=true} in
let rec loop c1 c2 =
- if c1 = c2 then constant ~loc (Const_char c1)
+ if c1 = c2 then constant ~loc:gloc (Const_char c1)
else
- or_ ~loc
- (constant ~loc (Const_char c1))
+ or_ ~loc:gloc
+ (constant ~loc:gloc (Const_char c1))
(loop (Char.chr(Char.code c1 + 1)) c2)
in
let p = if c1 <= c2 then loop c1 c2 else loop c2 c1 in
+ let p = {p with ppat_loc=loc} in
type_pat p expected_ty (* TODO: record 'extra' to remember about interval *)
| Ppat_interval _ ->
raise (Error (loc, !env, Invalid_interval))