aboutsummaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2019-02-19 18:07:19 +0100
committerEmilio Jesus Gallego Arias2019-02-19 18:07:19 +0100
commitc3cc72ccf586703ed009a8bdd5df8d40b0384ab2 (patch)
tree06a68b153c71a5cd8caf57572ffb59e52f507265 /test-suite
parent6e3850ce5092d5cb432ef917ae6ee79225089f6a (diff)
parenta8a26c87d52c30e5e5d1ba76f1920e8bc68bcd45 (diff)
Merge PR #9297: Two fixes in printing notations with patterns
Reviewed-by: ejgallego Ack-by: herbelin Reviewed-by: mattam82
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/output/Notations4.out20
-rw-r--r--test-suite/output/Notations4.v9
-rw-r--r--test-suite/success/Notations2.v11
3 files changed, 40 insertions, 0 deletions
diff --git a/test-suite/output/Notations4.out b/test-suite/output/Notations4.out
index efa895d709..5bf4ec7bfb 100644
--- a/test-suite/output/Notations4.out
+++ b/test-suite/output/Notations4.out
@@ -53,3 +53,23 @@ Notation Cn := Foo.FooCn
Expands to: Notation Notations4.J.Mfoo.Foo.Bar.Cn
let v := 0%test17 in v : myint63
: myint63
+fun y : nat => # (x, z) |-> y & y
+ : forall y : nat,
+ (?T1 * ?T2 -> ?T1 * ?T2 * nat) * (?T * ?T0 -> ?T * ?T0 * nat)
+where
+?T : [y : nat pat : ?T * ?T0 p0 : ?T * ?T0 p := p0 : ?T * ?T0
+ |- Type] (pat, p0, p cannot be used)
+?T0 : [y : nat pat : ?T * ?T0 p0 : ?T * ?T0 p := p0 : ?T * ?T0
+ |- Type] (pat, p0, p cannot be used)
+?T1 : [y : nat pat : ?T1 * ?T2 p0 : ?T1 * ?T2 p := p0 : ?T1 * ?T2
+ |- Type] (pat, p0, p cannot be used)
+?T2 : [y : nat pat : ?T1 * ?T2 p0 : ?T1 * ?T2 p := p0 : ?T1 * ?T2
+ |- Type] (pat, p0, p cannot be used)
+fun y : nat => # (x, z) |-> (x + y) & (y + z)
+ : forall y : nat,
+ (nat * ?T -> nat * ?T * nat) * (?T0 * nat -> ?T0 * nat * nat)
+where
+?T : [y : nat pat : nat * ?T p0 : nat * ?T p := p0 : nat * ?T
+ |- Type] (pat, p0, p cannot be used)
+?T0 : [y : nat pat : ?T0 * nat p0 : ?T0 * nat p := p0 : ?T0 * nat
+ |- Type] (pat, p0, p cannot be used)
diff --git a/test-suite/output/Notations4.v b/test-suite/output/Notations4.v
index b4c65ce196..b33ad17ed4 100644
--- a/test-suite/output/Notations4.v
+++ b/test-suite/output/Notations4.v
@@ -210,3 +210,12 @@ Module NumeralNotations.
Check let v := 0%test17 in v : myint63.
End Test17.
End NumeralNotations.
+
+Module K.
+
+Notation "# x |-> t & u" := ((fun x => (x,t)),(fun x => (x,u)))
+ (at level 0, x pattern, t, u at level 39).
+Check fun y : nat => # (x,z) |-> y & y.
+Check fun y : nat => # (x,z) |-> (x + y) & (y + z).
+
+End K.
diff --git a/test-suite/success/Notations2.v b/test-suite/success/Notations2.v
index 1b33863e3b..2533a39cc4 100644
--- a/test-suite/success/Notations2.v
+++ b/test-suite/success/Notations2.v
@@ -154,3 +154,14 @@ Module M16.
Print Grammar foo.
Print Grammar foo2.
End M16.
+
+(* Example showing the need for strong evaluation of
+ cases_pattern_of_glob_constr (this used to raise Not_found at some
+ time) *)
+
+Module M17.
+
+Notation "# x ## t & u" := ((fun x => (x,t)),(fun x => (x,u))) (at level 0, x pattern).
+Check fun y : nat => # (x,z) ## y & y.
+
+End M17.