summaryrefslogtreecommitdiff
path: root/testsuite/tests/warnings/w32.ml
diff options
context:
space:
mode:
authorXavier Clerc <xclerc@users.noreply.github.com>2017-09-13 22:50:42 +0100
committerAlain Frisch <alain@frisch.fr>2017-09-13 23:50:42 +0200
commit94b7ab801e767b6561f04b77e0e40e41f89505ec (patch)
tree3dd794fcf8d458c63c82ac62cffa70ee6ec1cab6 /testsuite/tests/warnings/w32.ml
parent588c23117ba14b272470400ac04644ccb3db1ad5 (diff)
downloadocaml-94b7ab801e767b6561f04b77e0e40e41f89505ec.tar.gz
Tentative fix for MPR#7624 (#1327)
* Tentative fix for MPR#7624. * Move the warning scope to the computation of pat_slot_list (because of delayed checks). * Fix computation of `warn_unused` (using binding attributes) and add tests. * Test enabling binding-level warning when they are globally disabled. * Rename `warn_unused` to `warn_about_unused_bindings` for better readablity.
Diffstat (limited to 'testsuite/tests/warnings/w32.ml')
-rw-r--r--testsuite/tests/warnings/w32.ml47
1 files changed, 47 insertions, 0 deletions
diff --git a/testsuite/tests/warnings/w32.ml b/testsuite/tests/warnings/w32.ml
new file mode 100644
index 0000000000..a3a17d3ba5
--- /dev/null
+++ b/testsuite/tests/warnings/w32.ml
@@ -0,0 +1,47 @@
+(* from MPR#7624 *)
+
+let[@warning "-32"] f x = x
+
+let g x = x
+
+let h x = x
+
+
+(* multiple bindings *)
+
+let[@warning "-32"] i x = x
+and j x = x
+
+let k x = x
+and[@warning "-32"] l x = x
+
+let[@warning "-32"] m x = x
+and n x = x
+
+let o x = x
+and[@warning "-32"] p x = x
+
+
+(* recursive bindings *)
+
+let[@warning "-32"] rec q x = x
+and r x = x
+
+let[@warning "-32"] rec s x = x
+and[@warning "-39"] t x = x
+
+let[@warning "-39"] rec u x = x
+and v x = v x
+
+
+(* disabled then re-enabled warnings *)
+
+module M = struct
+ [@@@warning "-32"]
+ let f x = x
+ let[@warning "+32"] g x = x
+ let[@warning "+32"] h x = x
+ and i x = x
+ let j x = x
+ and[@warning "+32"] k x = x
+end