aboutsummaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorHugo Herbelin2016-10-24 11:29:52 +0200
committerHugo Herbelin2017-05-22 12:06:59 +0200
commit9f463c144c54a013a0ee214383391f9fc48259d9 (patch)
treee897efafe48d53239e07309915d888184067ef4e /test-suite
parent9eb2f7480de8ded94a1b96eb4f6cc16d19a8c14d (diff)
Using type classes in the interpretation of "specialize" and "contradiction".
We do that by using constr_with_bindings rather than open_constr_with_bindings (+ extra call to typeclasses in "specialize"). If my understanding is right, the only effect would be to succeed more in cases where it was failing (in inh_conv_coerce_to_gen). In particular, "specialize" and "contradiction" already have a WITHHOLES test for rejecting pending holes. Incidentally, this answers enhancement #5153.
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/bugs/closed/5153.v8
-rw-r--r--test-suite/success/specialize.v8
2 files changed, 16 insertions, 0 deletions
diff --git a/test-suite/bugs/closed/5153.v b/test-suite/bugs/closed/5153.v
new file mode 100644
index 0000000000..be6407b5fa
--- /dev/null
+++ b/test-suite/bugs/closed/5153.v
@@ -0,0 +1,8 @@
+(* An example where it does not hurt having more type-classes resolution *)
+Class some_type := { Ty : Type }.
+Instance: some_type := { Ty := nat }.
+Arguments Ty : clear implicits.
+Goal forall (H : forall t : some_type, @Ty t -> False) (H' : False -> 1 = 2), 1 = 2.
+Proof.
+intros H H'.
+specialize (H' (@H _ O)). (* was failing *)
diff --git a/test-suite/success/specialize.v b/test-suite/success/specialize.v
index fba05cd902..4b41a509e5 100644
--- a/test-suite/success/specialize.v
+++ b/test-suite/success/specialize.v
@@ -72,3 +72,11 @@ intros.
specialize (H 1) as ->.
reflexivity.
Qed.
+
+(* A test from corn *)
+
+Goal (forall x y, x=0 -> y=0 -> True) -> True.
+intros.
+specialize (fun z => H 0 z eq_refl).
+exact (H 0 eq_refl).
+Qed.