aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2020-11-09 12:21:09 +0100
committerPierre-Marie Pédrot2020-11-09 12:21:09 +0100
commit07472bc4526ba97b356c5bebee65d92719426f05 (patch)
tree7114024157d36b34e2e4a557d66a57c7e9de335f
parentfcc82eaf6054cce65821fafafedd329dab732994 (diff)
parent1a36a0e4b29b358b05b02515c6c001672e3491e8 (diff)
Merge PR #13217: Addresses #13216: use of type classes in the return clause of a match.
Reviewed-by: ppedrot
-rw-r--r--doc/changelog/02-specification-language/13217-master+fix13216-typeclass-for-match-return-clause.rst5
-rw-r--r--pretyping/cases.ml2
-rw-r--r--test-suite/bugs/closed/bug_13216.v4
3 files changed, 10 insertions, 1 deletions
diff --git a/doc/changelog/02-specification-language/13217-master+fix13216-typeclass-for-match-return-clause.rst b/doc/changelog/02-specification-language/13217-master+fix13216-typeclass-for-match-return-clause.rst
new file mode 100644
index 0000000000..2d8230b965
--- /dev/null
+++ b/doc/changelog/02-specification-language/13217-master+fix13216-typeclass-for-match-return-clause.rst
@@ -0,0 +1,5 @@
+- **Fixed:**
+ Allow use of type classes inference for the return predicate of a :n:`match`
+ (was deactivated in versions 8.10 to 8.12, `#13217 <https://github.com/coq/coq/pull/13217>`_,
+ fixes `#13216 <https://github.com/coq/coq/issues/13216>`_,
+ by Hugo Herbelin).
diff --git a/pretyping/cases.ml b/pretyping/cases.ml
index 4a29db0dcf..5de0745d17 100644
--- a/pretyping/cases.ml
+++ b/pretyping/cases.ml
@@ -298,7 +298,7 @@ let inductive_template env sigma tmloc ind =
let ty = EConstr.of_constr ty in
let ty' = substl subst ty in
let sigma, e =
- Evarutil.new_evar env ~src:(hole_source n) ~typeclass_candidate:false sigma ty'
+ Evarutil.new_evar env ~src:(hole_source n) sigma ty'
in
(sigma, e::subst,e::evarl,n+1)
| LocalDef (na,b,ty) ->
diff --git a/test-suite/bugs/closed/bug_13216.v b/test-suite/bugs/closed/bug_13216.v
new file mode 100644
index 0000000000..54a28a9c53
--- /dev/null
+++ b/test-suite/bugs/closed/bug_13216.v
@@ -0,0 +1,4 @@
+Class A.
+Declare Instance a:A.
+Inductive T `(A) := C.
+Definition f x := match x with C _ => 0 end.