aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
authorherbelin2012-07-06 20:44:46 +0000
committerherbelin2012-07-06 20:44:46 +0000
commit73d5a4fd2d54c21a7d3b493993313d13618ce831 (patch)
tree552d619ae1393c82b69249b8f6d66de62ce1176f /pretyping
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
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/unification.ml6
1 files changed, 4 insertions, 2 deletions
diff --git a/pretyping/unification.ml b/pretyping/unification.ml
index 27e5864b35..cda1621e2f 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