diff options
| author | herbelin | 2010-06-13 11:09:55 +0000 |
|---|---|---|
| committer | herbelin | 2010-06-13 11:09:55 +0000 |
| commit | 5011e3387172d1d7151019d5d3f64cb92abcc898 (patch) | |
| tree | 7091bbcfa7964e9ebd5386eec3f46900baaa285e | |
| parent | 928d186f5dcc649793ea9f3dd8f880d93786dfe7 (diff) | |
Addressed bug #2310 and replaced anomaly "unknown meta" raised by "refine"
by a regular error in v8.3.
Example behaves better in trunk thanks to new proof engine. In fact,
there are two distinct solutions to a unification problem: should
"refine" commit to one of them or leave the problem open? For trunk,
improved the unification error message by enforcing nf_evar (but at
some time, nf_evar in error messages should move to himsg because it
is costly when errors are used for backtracking).
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13127 85f007b7-540e-0410-9357-904b9bb8a0f7
| -rw-r--r-- | pretyping/pretype_errors.ml | 1 | ||||
| -rw-r--r-- | test-suite/bugs/opened/shouldnotfail/2310.v | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/pretyping/pretype_errors.ml b/pretyping/pretype_errors.ml index e92ab3206a..13b5704ef0 100644 --- a/pretyping/pretype_errors.ml +++ b/pretyping/pretype_errors.ml @@ -165,6 +165,7 @@ let error_unsolvable_implicit loc env sigma evi e explain = (PretypeError (env_ise sigma env, UnsolvableImplicit (evi, e, explain))) let error_cannot_unify env sigma (m,n) = + let m = nf_evar sigma m and n = nf_evar sigma n in raise (PretypeError (env_ise sigma env,CannotUnify (m,n))) let error_cannot_unify_local env sigma (m,n,sn) = diff --git a/test-suite/bugs/opened/shouldnotfail/2310.v b/test-suite/bugs/opened/shouldnotfail/2310.v new file mode 100644 index 0000000000..8d1a5149ed --- /dev/null +++ b/test-suite/bugs/opened/shouldnotfail/2310.v @@ -0,0 +1,17 @@ +(* Dependent higher-order hole in "refine" (simplified version) *) + +Set Implicit Arguments. + +Inductive Nest t := Cons : Nest (prod t t) -> Nest t. + +Definition cast A x y Heq P H := @eq_rect A x P H y Heq. + +Definition replace a (y:Nest (prod a a)) : a = a -> Nest a. + +(* This used to raise an anomaly Unknown Meta in 8.2 and 8.3beta. + It raises a regular error in 8.3 and almost succeeds with the new + proof engine: there are two solutions to a unification problem + (P:=\a.Nest (prod a a) and P:=\_.Nest (prod a a)) and refine should either + leave P as subgoal or choose itself one solution *) + +intros. refine (Cons (cast H _ y)). |
