diff options
| author | Pierre-Marie Pédrot | 2020-06-08 12:20:51 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2020-06-08 12:20:51 +0200 |
| commit | 522a1d3f4e1dbc8c09e614a8087be4ca3e81a012 (patch) | |
| tree | 1f031849c5aeae8f0d59cf5c3d3856051582dc94 | |
| parent | 3b030bff4c10b8d25635913cdc037df35f142813 (diff) | |
| parent | bc842a94b18f3a09ea1127b0bd3e08599dd97305 (diff) | |
Merge PR #12471: Fix uncaught NotArity in inductive type
Reviewed-by: ejgallego
Reviewed-by: ppedrot
| -rw-r--r-- | test-suite/bugs/closed/bug_12390.v | 3 | ||||
| -rw-r--r-- | vernac/comInductive.ml | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/test-suite/bugs/closed/bug_12390.v b/test-suite/bugs/closed/bug_12390.v new file mode 100644 index 0000000000..a8fda29a6f --- /dev/null +++ b/test-suite/bugs/closed/bug_12390.v @@ -0,0 +1,3 @@ +Fail Inductive foo : forall P, P := . +Fail Inductive bar : nat := . +Fail Inductive baz : _ := . diff --git a/vernac/comInductive.ml b/vernac/comInductive.ml index 4242f06844..95489c9132 100644 --- a/vernac/comInductive.ml +++ b/vernac/comInductive.ml @@ -117,7 +117,7 @@ let intern_ind_arity env sigma ind = let pretype_ind_arity env sigma (loc, c, impls, pseudo_poly) = let sigma,t = understand_tcc env sigma ~expected_type:IsType c in match Reductionops.sort_of_arity env sigma t with - | exception Invalid_argument _ -> + | exception Reduction.NotArity -> user_err ?loc (str "Not an arity") | s -> let concl = match pseudo_poly with |
