aboutsummaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorcoqbot-app[bot]2021-02-03 18:38:16 +0000
committerGitHub2021-02-03 18:38:16 +0000
commit730e0f46deb5cef9f6c61cfefe66e0404fb722be (patch)
tree75bba9ef80c938a90afb653410aace2974054b2c /test-suite
parent8615aac5fc342b2184b3431abec15dbab621efba (diff)
parent570744638ab4b08286562c0f4d45a7928ed008b0 (diff)
Merge PR #13776: Fix #13739 - disable some warnings when calling Function.
Reviewed-by: gares Ack-by: Zimmi48 Ack-by: SkySkimmer
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/output/Function.out0
-rw-r--r--test-suite/output/Function.v31
2 files changed, 31 insertions, 0 deletions
diff --git a/test-suite/output/Function.out b/test-suite/output/Function.out
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test-suite/output/Function.out
diff --git a/test-suite/output/Function.v b/test-suite/output/Function.v
new file mode 100644
index 0000000000..b3e2a93895
--- /dev/null
+++ b/test-suite/output/Function.v
@@ -0,0 +1,31 @@
+Require Import FunInd List.
+
+(* Explanations: This kind of pattern matching displays a legitimate
+ unused variable warning in v8.13.
+
+Fixpoint f (l:list nat) : nat :=
+ match l with
+ | nil => O
+ | S n :: nil => 1
+ | x :: l' => f l'
+ end.
+*)
+
+(* In v8.13 the same code with "Function" generates a lot more
+ warnings about variables created automatically by Function. These
+ are not legitimate. PR #13776 (post v8.13) removes all warnings
+ about pattern matching variables (and non truly recursive fixpoint)
+ for "Function". So this should not generate any warning. Note that
+ this PR removes also the legitimate warnings. It would be better if
+ this test generate the same warning as the Fixpoint above. This
+ test would then need to be updated. *)
+
+(* Ensuring the warning is a warning. *)
+Set Warnings "matching-variable".
+(* But no warning generated here. *)
+Function f (l:list nat) : nat :=
+ match l with
+ | nil => O
+ | S n :: nil => 1
+ | n :: l' => f l'
+ end.