diff options
author | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2013-02-28 07:33:37 +0000 |
---|---|---|
committer | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2013-02-28 07:33:37 +0000 |
commit | c43f9128237ac16fa0d7741744e3944ca72e7475 (patch) | |
tree | 9d36fa1cb3364d16c00e506d786822303b6a027c /kernel/type_errors.ml | |
parent | 87bd13c7a6552f33782e0e69ef705b356a2cf741 (diff) |
More informative error when a global reference is used in a context of
local variables which is a different from the one of its definition. E.g.:
Section A.
Variable n:nat.
Definition c:=n.
Goal True.
clear n.
Check c.
[I'm however unsure that "n" should not continue to be accessible via
some global (qualified) name, even after the "clear n".]
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16256 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel/type_errors.ml')
-rw-r--r-- | kernel/type_errors.ml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/type_errors.ml b/kernel/type_errors.ml index 4c2799df8..42b93dd37 100644 --- a/kernel/type_errors.ml +++ b/kernel/type_errors.ml @@ -41,7 +41,7 @@ type type_error = | UnboundVar of variable | NotAType of unsafe_judgment | BadAssumption of unsafe_judgment - | ReferenceVariables of constr + | ReferenceVariables of identifier * constr | ElimArity of inductive * sorts_family list * constr * unsafe_judgment * (sorts_family * sorts_family * arity_error) option | CaseNotInductive of unsafe_judgment @@ -74,8 +74,8 @@ let error_not_type env j = let error_assumption env j = raise (TypeError (env, BadAssumption j)) -let error_reference_variables env id = - raise (TypeError (env, ReferenceVariables id)) +let error_reference_variables env id c = + raise (TypeError (env, ReferenceVariables (id,c))) let error_elim_arity env ind aritylst c pj okinds = raise (TypeError (env, ElimArity (ind,aritylst,c,pj,okinds))) |