summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename/should_compile
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/rename/should_compile')
-rw-r--r--testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr7
-rw-r--r--testsuite/tests/rename/should_compile/T20609.hs23
-rw-r--r--testsuite/tests/rename/should_compile/T20609.stderr49
-rw-r--r--testsuite/tests/rename/should_compile/T20609a.hs12
-rw-r--r--testsuite/tests/rename/should_compile/T20609a.stderr7
-rw-r--r--testsuite/tests/rename/should_compile/T20609b.hs13
-rw-r--r--testsuite/tests/rename/should_compile/T20609b.stderr7
-rw-r--r--testsuite/tests/rename/should_compile/T20609c.hs8
-rw-r--r--testsuite/tests/rename/should_compile/T20609c.stderr14
-rw-r--r--testsuite/tests/rename/should_compile/T20609d.hs6
-rw-r--r--testsuite/tests/rename/should_compile/T20609d.stderr7
-rw-r--r--testsuite/tests/rename/should_compile/all.T5
12 files changed, 158 insertions, 0 deletions
diff --git a/testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr b/testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr
index 5852074450..88c7e7c771 100644
--- a/testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr
+++ b/testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr
@@ -1,4 +1,11 @@
+ExplicitForAllRules1.hs:46:31: warning: [-Wforall-identifier (in -Wdefault)]
+ The use of ‘forall’ as an identifier
+ will become an error in a future GHC release.
+ Suggested fix:
+ Consider using another name, such as
+ ‘forAll’, ‘for_all’, or ‘forall_’.
+
ExplicitForAllRules1.hs:49:31: warning: [-Wunused-foralls (in -Wextra)]
Unused quantified type variable ‘b’
In the rewrite rule "example7"
diff --git a/testsuite/tests/rename/should_compile/T20609.hs b/testsuite/tests/rename/should_compile/T20609.hs
new file mode 100644
index 0000000000..7e8955f29f
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T20609.hs
@@ -0,0 +1,23 @@
+module T20609 where
+
+-- Triggers the warning (definition/binding sites):
+-- ------------------------------------------------
+
+forall x = ()
+
+(∀) x = ()
+
+fparam forall = ()
+
+asPattern forall@Nothing = ()
+
+localLet = let forall = () in forall
+
+{-# RULES "rule" forall forall. id forall = forall #-}
+
+{-# RULES "rule_sig" forall a. forall (forall :: a). id forall = forall #-}
+
+-- Does not trigger the warning (use sites):
+-- -----------------------------------------
+
+other = forall
diff --git a/testsuite/tests/rename/should_compile/T20609.stderr b/testsuite/tests/rename/should_compile/T20609.stderr
new file mode 100644
index 0000000000..a9958e2b85
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T20609.stderr
@@ -0,0 +1,49 @@
+
+T20609.hs:6:1: warning: [-Wforall-identifier (in -Wdefault)]
+ The use of ‘forall’ as an identifier
+ will become an error in a future GHC release.
+ Suggested fix:
+ Consider using another name, such as
+ ‘forAll’, ‘for_all’, or ‘forall_’.
+
+T20609.hs:8:1: warning: [-Wforall-identifier (in -Wdefault)]
+ The use of ‘∀’ as an identifier
+ will become an error in a future GHC release.
+ Suggested fix:
+ Consider using another name, such as
+ ‘forAll’, ‘for_all’, or ‘forall_’.
+
+T20609.hs:10:8: warning: [-Wforall-identifier (in -Wdefault)]
+ The use of ‘forall’ as an identifier
+ will become an error in a future GHC release.
+ Suggested fix:
+ Consider using another name, such as
+ ‘forAll’, ‘for_all’, or ‘forall_’.
+
+T20609.hs:12:11: warning: [-Wforall-identifier (in -Wdefault)]
+ The use of ‘forall’ as an identifier
+ will become an error in a future GHC release.
+ Suggested fix:
+ Consider using another name, such as
+ ‘forAll’, ‘for_all’, or ‘forall_’.
+
+T20609.hs:14:16: warning: [-Wforall-identifier (in -Wdefault)]
+ The use of ‘forall’ as an identifier
+ will become an error in a future GHC release.
+ Suggested fix:
+ Consider using another name, such as
+ ‘forAll’, ‘for_all’, or ‘forall_’.
+
+T20609.hs:16:25: warning: [-Wforall-identifier (in -Wdefault)]
+ The use of ‘forall’ as an identifier
+ will become an error in a future GHC release.
+ Suggested fix:
+ Consider using another name, such as
+ ‘forAll’, ‘for_all’, or ‘forall_’.
+
+T20609.hs:18:40: warning: [-Wforall-identifier (in -Wdefault)]
+ The use of ‘forall’ as an identifier
+ will become an error in a future GHC release.
+ Suggested fix:
+ Consider using another name, such as
+ ‘forAll’, ‘for_all’, or ‘forall_’.
diff --git a/testsuite/tests/rename/should_compile/T20609a.hs b/testsuite/tests/rename/should_compile/T20609a.hs
new file mode 100644
index 0000000000..0cf753760f
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T20609a.hs
@@ -0,0 +1,12 @@
+module T20609a where
+
+-- Triggers the warning (definition/binding sites):
+-- ------------------------------------------------
+
+data MyRecord a = R { forall :: a }
+
+-- Does not trigger the warning (use sites):
+-- -----------------------------------------
+
+x = forall (R { forall = () })
+f (R { forall = r }) = r
diff --git a/testsuite/tests/rename/should_compile/T20609a.stderr b/testsuite/tests/rename/should_compile/T20609a.stderr
new file mode 100644
index 0000000000..d828a1b269
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T20609a.stderr
@@ -0,0 +1,7 @@
+
+T20609a.hs:6:23: warning: [-Wforall-identifier (in -Wdefault)]
+ The use of ‘forall’ as an identifier
+ will become an error in a future GHC release.
+ Suggested fix:
+ Consider using another name, such as
+ ‘forAll’, ‘for_all’, or ‘forall_’.
diff --git a/testsuite/tests/rename/should_compile/T20609b.hs b/testsuite/tests/rename/should_compile/T20609b.hs
new file mode 100644
index 0000000000..2e08bdcee2
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T20609b.hs
@@ -0,0 +1,13 @@
+module T20609b where
+
+-- Triggers the warning (definition/binding sites):
+-- ------------------------------------------------
+
+class MyClass c where
+ forall :: c -> ()
+
+-- Does not trigger the warning (use sites):
+-- -----------------------------------------
+
+instance MyClass () where
+ forall = id
diff --git a/testsuite/tests/rename/should_compile/T20609b.stderr b/testsuite/tests/rename/should_compile/T20609b.stderr
new file mode 100644
index 0000000000..c356dde8b0
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T20609b.stderr
@@ -0,0 +1,7 @@
+
+T20609b.hs:7:3: warning: [-Wforall-identifier (in -Wdefault)]
+ The use of ‘forall’ as an identifier
+ will become an error in a future GHC release.
+ Suggested fix:
+ Consider using another name, such as
+ ‘forAll’, ‘for_all’, or ‘forall_’.
diff --git a/testsuite/tests/rename/should_compile/T20609c.hs b/testsuite/tests/rename/should_compile/T20609c.hs
new file mode 100644
index 0000000000..2e36f8c7e1
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T20609c.hs
@@ -0,0 +1,8 @@
+{-# LANGUAGE PatternSynonyms #-}
+
+module T20609c where
+
+pattern Pat forall = forall
+
+pattern RPat { forall } = forall
+
diff --git a/testsuite/tests/rename/should_compile/T20609c.stderr b/testsuite/tests/rename/should_compile/T20609c.stderr
new file mode 100644
index 0000000000..c22ead3d0b
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T20609c.stderr
@@ -0,0 +1,14 @@
+
+T20609c.hs:5:22: warning: [-Wforall-identifier (in -Wdefault)]
+ The use of ‘forall’ as an identifier
+ will become an error in a future GHC release.
+ Suggested fix:
+ Consider using another name, such as
+ ‘forAll’, ‘for_all’, or ‘forall_’.
+
+T20609c.hs:7:27: warning: [-Wforall-identifier (in -Wdefault)]
+ The use of ‘forall’ as an identifier
+ will become an error in a future GHC release.
+ Suggested fix:
+ Consider using another name, such as
+ ‘forAll’, ‘for_all’, or ‘forall_’.
diff --git a/testsuite/tests/rename/should_compile/T20609d.hs b/testsuite/tests/rename/should_compile/T20609d.hs
new file mode 100644
index 0000000000..bed945bcfa
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T20609d.hs
@@ -0,0 +1,6 @@
+module T20609d where
+
+import Data.Word (Word8)
+
+foreign import ccall unsafe "forall"
+ forall :: IO Word8
diff --git a/testsuite/tests/rename/should_compile/T20609d.stderr b/testsuite/tests/rename/should_compile/T20609d.stderr
new file mode 100644
index 0000000000..8060b3298f
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T20609d.stderr
@@ -0,0 +1,7 @@
+
+T20609d.hs:6:3: warning: [-Wforall-identifier (in -Wdefault)]
+ The use of ‘forall’ as an identifier
+ will become an error in a future GHC release.
+ Suggested fix:
+ Consider using another name, such as
+ ‘forAll’, ‘for_all’, or ‘forall_’.
diff --git a/testsuite/tests/rename/should_compile/all.T b/testsuite/tests/rename/should_compile/all.T
index 2148470c66..8e55b3705a 100644
--- a/testsuite/tests/rename/should_compile/all.T
+++ b/testsuite/tests/rename/should_compile/all.T
@@ -177,3 +177,8 @@ test('T18302', expect_broken(18302), compile, [''])
test('T17853', [], multimod_compile, ['T17853', '-v0'])
test('T19966', expect_broken(19966), compile, ['-fdefer-out-of-scope-variables'])
test('T20472', normal, compile, [''])
+test('T20609', normal, compile, [''])
+test('T20609a', normal, compile, [''])
+test('T20609b', normal, compile, [''])
+test('T20609c', normal, compile, [''])
+test('T20609d', normal, compile, [''])