diff options
author | msozeau <msozeau@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2008-10-24 22:28:26 +0000 |
---|---|---|
committer | msozeau <msozeau@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2008-10-24 22:28:26 +0000 |
commit | dac45df4c768349454e5fb950b7a566a600af597 (patch) | |
tree | 1c764c45719f24f9082334b9018b34d47368d311 /proofs | |
parent | 8a5f877b257133d12045e11ada64674e5a481ae6 (diff) |
Raise informative errors instead of Failures or anomalies in case a meta
type contains a meta as this is currently unsupported in the
refiner. Fixes bugs #1980 and #1981.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@11501 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'proofs')
-rw-r--r-- | proofs/clenvtac.ml | 3 | ||||
-rw-r--r-- | proofs/logic.ml | 3 | ||||
-rw-r--r-- | proofs/logic.mli | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/proofs/clenvtac.ml b/proofs/clenvtac.ml index 5c204c8bb..f368ed379 100644 --- a/proofs/clenvtac.ml +++ b/proofs/clenvtac.ml @@ -54,7 +54,8 @@ let clenv_cast_meta clenv = (match Evd.find_meta clenv.evd mv with | Clval (_,(body,_),_) -> body.rebus | Cltyp (_,typ) -> - assert (not (occur_meta typ.rebus)); + if occur_meta typ.rebus then + raise (RefinerError (MetaInType typ.rebus)); mkCast (mkMeta mv, DEFAULTcast, typ.rebus)) | App(f,args) -> mkApp (crec_hd f, Array.map crec args) | Case(ci,p,c,br) -> mkCase (ci, crec p, crec_hd c, Array.map crec br) diff --git a/proofs/logic.ml b/proofs/logic.ml index c358de9ba..0368e9744 100644 --- a/proofs/logic.ml +++ b/proofs/logic.ml @@ -37,6 +37,7 @@ type refiner_error = | CannotApply of constr * constr | NotWellTyped of constr | NonLinearProof of constr + | MetaInType of constr (* Errors raised by the tactics *) | IntroNeedsProduct @@ -251,7 +252,7 @@ let rec mk_refgoals sigma goal goalacc conclty trm = match kind_of_term trm with | Meta _ -> if !check && occur_meta conclty then - anomaly "refine called with a dependent meta"; + raise (RefinerError (MetaInType conclty)); (mk_goal hyps (nf_betaiota conclty))::goalacc, conclty | Cast (t,_, ty) -> diff --git a/proofs/logic.mli b/proofs/logic.mli index 88e77fd7b..8bc48ed54 100644 --- a/proofs/logic.mli +++ b/proofs/logic.mli @@ -54,6 +54,7 @@ type refiner_error = | CannotApply of constr * constr | NotWellTyped of constr | NonLinearProof of constr + | MetaInType of constr (*i Errors raised by the tactics i*) | IntroNeedsProduct |