Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

typecore.ml: fix format's expected-type mistake

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14826 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information...
commit 4907bcf8037fc0b629d96331c0b1a210c1db58a4 1 parent 39ab064
Gabriel Scherer authored
Showing with 4 additions and 8 deletions.
  1. +4 −8 typing/typecore.ml
View
12 typing/typecore.ml
@@ -1792,7 +1792,8 @@ and type_expect_ ?in_function env sexp ty_expected =
| _ -> false
in
if is_format then
- type_format loc str env sexp.pexp_attributes
+ let format_parsetree = { sexp with pexp_desc = type_format loc str env } in
+ type_expect ?in_function env format_parsetree ty_expected
else
rue {
exp_desc = Texp_constant cst;
@@ -2743,7 +2744,7 @@ and get_camlinternalFormat_path env tyname =
Some (Path.Pdot (cfb_path, tyname, 0))
with Not_found -> None
-and type_format loc str env attr =
+and type_format loc str env =
try
CamlinternalFormatBasics.(CamlinternalFormat.(
let mk_exp_loc pexp_desc = {
@@ -2987,12 +2988,7 @@ and type_format loc str env attr =
| 0 -> []
| _ -> mk_typ_loc Ptyp_any :: gen_params (n - 1) in
mk_typ_loc (Ptyp_constr (mk_lid_loc lid, gen_params 6)) in
- let constrained_exp = {
- pexp_desc = Pexp_constraint (exp, pervasives_format6_ty);
- pexp_loc = loc;
- pexp_attributes = attr;
- } in
- type_exp env constrained_exp
+ Pexp_constraint (exp, pervasives_format6_ty)
))
with Failure msg ->
raise (Error (loc, env, Invalid_format msg))
Please sign in to comment.
Something went wrong with that request. Please try again.