From d24bab45123f4e4eb3918be55fb1a7dc54be2b3b Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Thu, 5 Oct 2017 00:41:29 +0200 Subject: Fixing #5765 (an anomaly with 'pat in parameters of inductive definition). --- test-suite/bugs/closed/5765.v | 3 +++ vernac/command.ml | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 test-suite/bugs/closed/5765.v diff --git a/test-suite/bugs/closed/5765.v b/test-suite/bugs/closed/5765.v new file mode 100644 index 0000000000..343ab49357 --- /dev/null +++ b/test-suite/bugs/closed/5765.v @@ -0,0 +1,3 @@ +(* 'pat binder not (yet?) allowed in parameters of inductive types *) + +Fail Inductive X '(a,b) := x. diff --git a/vernac/command.ml b/vernac/command.ml index 120f9590f2..a1a87d54e0 100644 --- a/vernac/command.ml +++ b/vernac/command.ml @@ -518,7 +518,8 @@ let check_param = function | CLocalDef (na, _, _) -> check_named na | CLocalAssum (nas, Default _, _) -> List.iter check_named nas | CLocalAssum (nas, Generalized _, _) -> () -| CLocalPattern _ -> assert false +| CLocalPattern (loc,_) -> + Loc.raise ?loc (Stream.Error "pattern with quote not allowed here.") let interp_mutual_inductive (paramsl,indl) notations cum poly prv finite = check_all_names_different indl; -- cgit v1.2.3