aboutsummaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorHugo Herbelin2020-07-13 10:42:37 +0200
committerHugo Herbelin2020-11-15 09:55:05 +0100
commit69a3d310349eb3697b037cb4c8637cec408802ee (patch)
tree32a35f92ee4265f4adfe30d2af406d06f9086f57 /test-suite
parenta118b906b3da7cb2e03a72f7a8079a7fc99c6f84 (diff)
Propagating scope information in indirect application to a reference.
This allows the following to interpret "0" in the expected scope: Notation "0" := true : bool_scope. Axiom f : bool -> bool -> nat. Record R := { p : bool -> nat }. Check (@f 0) 0. Check fun r => r.(@p) 0.
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/success/Notations2.v4
-rw-r--r--test-suite/success/Scopes.v12
2 files changed, 14 insertions, 2 deletions
diff --git a/test-suite/success/Notations2.v b/test-suite/success/Notations2.v
index 382c252727..fb8bbfd043 100644
--- a/test-suite/success/Notations2.v
+++ b/test-suite/success/Notations2.v
@@ -51,8 +51,8 @@ Check fun A (x : prod' bool A) => match x with (@pair' _ 0) _ y 0%bool => 2 | _
Notation c3 x := ((@pair') _ x).
Check (@pair') _ 0%bool _ 0%bool 0%bool : prod' bool bool. (* @ is blocking implicit and scopes *)
Check ((@pair') _ 0%bool) _ 0%bool 0%bool : prod' bool bool. (* parentheses and @ are blocking implicit and scopes *)
-Check c3 0 0 0 : prod' nat bool. (* First scope is blocked but not the last two scopes *)
-Check fun A (x :prod' nat A) => match x with c3 0 y 0 => 2 | _ => 1 end.
+Check c3 0 0 0 : prod' bool bool.
+Check fun A (x :prod' bool A) => match x with c3 0 y 0 => 2 | _ => 1 end.
(* 4. Abbreviations do not stop implicit arguments to be inserted and scopes to be used *)
(* unless an atomic @ is given *)
diff --git a/test-suite/success/Scopes.v b/test-suite/success/Scopes.v
index 06697af901..8b7d239dcd 100644
--- a/test-suite/success/Scopes.v
+++ b/test-suite/success/Scopes.v
@@ -26,3 +26,15 @@ Definition c := ε : U.
Goal True.
assert (nat * nat).
Abort.
+
+(* Check propagation of scopes in indirect applications to references *)
+
+Module PropagateIndirect.
+Notation "0" := true : bool_scope.
+
+Axiom f : bool -> bool -> nat.
+Check (@f 0) 0.
+
+Record R := { p : bool -> nat }.
+Check fun r => r.(@p) 0.
+End PropagateIndirect.