aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-07-06 20:44:46 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-07-06 20:44:46 +0000
commit73d5a4fd2d54c21a7d3b493993313d13618ce831 (patch)
tree552d619ae1393c82b69249b8f6d66de62ce1176f
parent3e6d3a9a35660e32c478ac8e5da5e76d25c905b5 (diff)
Continuing r15459: it helps testing occur-check early in some
situations (see rewrite MonoidMonadTrans.bind_toLower' in Misc/QuicksortComplexity/monoid_expec.v). Also fixing badly designed test 2817.v. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15543 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--pretyping/unification.ml6
-rw-r--r--test-suite/bugs/closed/shouldsucceed/2817.v3
2 files changed, 6 insertions, 3 deletions
diff --git a/pretyping/unification.ml b/pretyping/unification.ml
index 27e5864b3..cda1621e2 100644
--- a/pretyping/unification.ml
+++ b/pretyping/unification.ml
@@ -397,7 +397,8 @@ let unify_0_with_initial_metas (sigma,ms,es as subst) conv_at_top env cv_pb flag
check_compatibility curenv substn tyM tyN);
if k2 < k1 then sigma,(k1,cN,stN)::metasubst,evarsubst
else sigma,(k2,cM,stM)::metasubst,evarsubst
- | Meta k, _ ->
+ | Meta k, _
+ when not (dependent cM cN) (* helps early trying alternatives *) ->
if wt && flags.check_applied_meta_types then
(let tyM = Typing.meta_type sigma k in
let tyN = get_type_of curenv sigma cN in
@@ -410,7 +411,8 @@ let unify_0_with_initial_metas (sigma,ms,es as subst) conv_at_top env cv_pb flag
(k,lift (-nb) cN,snd (extract_instance_status pb))::metasubst,
evarsubst)
else error_cannot_unify_local curenv sigma (m,n,cN)
- | _, Meta k ->
+ | _, Meta k
+ when not (dependent cN cM) (* helps early trying alternatives *) ->
if wt && flags.check_applied_meta_types then
(let tyM = get_type_of curenv sigma cM in
let tyN = Typing.meta_type sigma k in
diff --git a/test-suite/bugs/closed/shouldsucceed/2817.v b/test-suite/bugs/closed/shouldsucceed/2817.v
index 25ac15574..08dff9928 100644
--- a/test-suite/bugs/closed/shouldsucceed/2817.v
+++ b/test-suite/bugs/closed/shouldsucceed/2817.v
@@ -5,4 +5,5 @@ Goal forall (f: nat -> nat -> Prop) (x:bool)
(H0: forall x0, f (if x then x0 else x0) x0),
False.
-intros; apply H in H0. (* crashes *)
+intros.
+Fail apply H in H0. (* should fail without exhausting the stack *)