Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Accept a fully empty pattern matching. This can be generated by Camlp…

…4 using its revised syntax, and this seems to be used in the wild.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14749 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information...
commit 27e9e78637cd1d99e3bd7a5069d79b5a7caf2371 1 parent b1943e1
@alainfrisch alainfrisch authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 typing/typecore.ml
View
6 typing/typecore.ml
@@ -2107,7 +2107,11 @@ and type_expect_ ?in_function env sexp ty_expected =
split_cases (c :: vc) ec rest
in
let val_caselist, exn_caselist = split_cases [] [] caselist in
- if val_caselist = [] then raise (Error (loc, env, No_value_clauses));
+ if val_caselist = [] && exn_caselist <> [] then
+ raise (Error (loc, env, No_value_clauses));
+ (* Note: val_caselist = [] and exn_caselist = [], i.e. a fully
+ empty pattern matching can be generated by Camlp4 with its
+ revised syntax. Let's accept it for backward compatibility. *)
let val_cases, partial =
type_cases env arg.exp_type ty_expected true loc val_caselist in
let exn_cases, _ =
Please sign in to comment.
Something went wrong with that request. Please try again.