aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2014-03-01 16:34:54 +0100
committerPierre-Marie Pédrot2014-03-01 17:11:15 +0100
commit4cddb7d0765a091c6514a85475dcdd7af34aaf29 (patch)
tree90e3aa55f64c9ecb0d96e1d9d9fb68497f268fca
parentda0db0a69a4e78841f9a8cf06ae4be17292bedbf (diff)
Never suppress the typing constraint of bound variables whose name was
reserved with Implicit Type.
-rw-r--r--interp/constrextern.ml6
-rw-r--r--interp/reserve.ml13
-rw-r--r--interp/reserve.mli1
-rw-r--r--test-suite/output/Notations2.out2
4 files changed, 4 insertions, 18 deletions
diff --git a/interp/constrextern.ml b/interp/constrextern.ml
index ffb8a46ea1..a3410544ef 100644
--- a/interp/constrextern.ml
+++ b/interp/constrextern.ml
@@ -664,12 +664,12 @@ let rec extern inctx scopes vars r =
extern inctx scopes (add_vname vars na) c)
| GProd (loc,na,bk,t,c) ->
- let t = extern_typ scopes vars (anonymize_if_reserved na t) in
+ let t = extern_typ scopes vars t in
let (idl,c) = factorize_prod scopes (add_vname vars na) na bk t c in
CProdN (loc,[(Loc.ghost,na)::idl,Default bk,t],c)
| GLambda (loc,na,bk,t,c) ->
- let t = extern_typ scopes vars (anonymize_if_reserved na t) in
+ let t = extern_typ scopes vars t in
let (idl,c) = factorize_lambda inctx scopes (add_vname vars na) na bk t c in
CLambdaN (loc,[(Loc.ghost,na)::idl,Default bk,t],c)
@@ -788,7 +788,7 @@ and extern_local_binder scopes vars = function
LocalRawDef((Loc.ghost,na), extern false scopes vars bd) :: l)
| (na,bk,None,ty)::l ->
- let ty = extern_typ scopes vars (anonymize_if_reserved na ty) in
+ let ty = extern_typ scopes vars ty in
(match extern_local_binder scopes (name_fold Id.Set.add na vars) l with
(assums,ids,LocalRawAssum(nal,k,ty')::l)
when constr_expr_eq ty ty' &&
diff --git a/interp/reserve.ml b/interp/reserve.ml
index 4328be7d86..744cf616c8 100644
--- a/interp/reserve.ml
+++ b/interp/reserve.ml
@@ -112,16 +112,3 @@ let default_env () = {
ninterp_rec_vars = Id.Map.empty;
ninterp_only_parse = false;
}
-
-let anonymize_if_reserved na t = match na with
- | Name id as na ->
- (try
- if not !Flags.raw_print &&
- (try
- let ntn = notation_constr_of_glob_constr (default_env ()) t in
- Pervasives.(=) ntn (find_reserved_type id) (** FIXME *)
- with UserError _ -> false)
- then GHole (Loc.ghost,Evar_kinds.BinderType na,None)
- else t
- with Not_found -> t)
- | Anonymous -> t
diff --git a/interp/reserve.mli b/interp/reserve.mli
index de72a410d1..8ae55d0961 100644
--- a/interp/reserve.mli
+++ b/interp/reserve.mli
@@ -14,4 +14,3 @@ open Notation_term
val declare_reserved_type : Id.t located list -> notation_constr -> unit
val find_reserved_type : Id.t -> notation_constr
-val anonymize_if_reserved : Name.t -> glob_constr -> glob_constr
diff --git a/test-suite/output/Notations2.out b/test-suite/output/Notations2.out
index b42ef2c511..958001c39f 100644
--- a/test-suite/output/Notations2.out
+++ b/test-suite/output/Notations2.out
@@ -10,7 +10,7 @@ end
: nat
let '(a, _, _) := (2, 3, 4) in a
: nat
-exists myx (y : bool), myx = y
+exists myx y : bool, myx = y
: Prop
fun (P : nat -> nat -> Prop) (x : nat) => exists x0, P x x0
: (nat -> nat -> Prop) -> nat -> Prop