summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2005-04-04 04:34:53 +0000
committerJacques Garrigue <garrigue at math.nagoya-u.ac.jp>2005-04-04 04:34:53 +0000
commit827d03d59f03e5d1d4b9603c129609e5084356a3 (patch)
tree5bbeffe2b2a2b39d130a7e341afeaa12248fbb35
parentf30c72cb084926eb6e78c60a9dfcaaefaf08c321 (diff)
bug in type_approx
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6829 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--stdlib/sys.ml2
-rw-r--r--typing/typecore.ml11
2 files changed, 6 insertions, 7 deletions
diff --git a/stdlib/sys.ml b/stdlib/sys.ml
index c186f1cd0..494916bae 100644
--- a/stdlib/sys.ml
+++ b/stdlib/sys.ml
@@ -78,4 +78,4 @@ let catch_break on =
(* OCaml version string, must be in the format described in sys.mli. *)
-let ocaml_version = "3.09+dev19 (2005-03-24)";;
+let ocaml_version = "3.09+dev20 (2005-04-04)";;
diff --git a/typing/typecore.ml b/typing/typecore.ml
index b5dd272fb..6bb26c53f 100644
--- a/typing/typecore.ml
+++ b/typing/typecore.ml
@@ -777,12 +777,11 @@ let rec type_approx env sexp =
in
let ty = type_approx env e
and ty1 = approx_ty_opt sty1
- and ty2 = approx_ty_opt sty2
- in begin
- try unify env ty ty1; unify env ty1 ty2; ty2
- with Unify trace ->
- raise(Error(sexp.pexp_loc, Expr_type_clash trace))
- end
+ and ty2 = approx_ty_opt sty2 in
+ begin try unify env ty ty1 with Unify trace ->
+ raise(Error(sexp.pexp_loc, Expr_type_clash trace))
+ end;
+ if sty2 = None then ty1 else ty2
| _ -> newvar ()
(* List labels in a function type, and whether return type is a variable *)