summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/rename')
-rw-r--r--testsuite/tests/rename/should_compile/ExplicitForAllRules1.hs14
-rw-r--r--testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr12
2 files changed, 15 insertions, 11 deletions
diff --git a/testsuite/tests/rename/should_compile/ExplicitForAllRules1.hs b/testsuite/tests/rename/should_compile/ExplicitForAllRules1.hs
index 7862468d17..bf3fab4efb 100644
--- a/testsuite/tests/rename/should_compile/ExplicitForAllRules1.hs
+++ b/testsuite/tests/rename/should_compile/ExplicitForAllRules1.hs
@@ -14,20 +14,24 @@ import Data.Kind
{-# RULES
"example" forall a b. forall. map @a @b f = f
-"example2" forall a. forall (x :: a). id x = x
+"example2" forall a. forall (x :: a). id' x = x
#-}
{-# NOINLINE f #-}
f :: a -> b
f = undefined
+id' :: a -> a
+id' x = x
+{-# NOINLINE id' #-}
+
-- More tests
{-# RULES
"example3" forall (a :: Type -> Type) (b :: a Int) c. forall x y. g @(Proxy b) @(Proxy c) x y = ()
-"example4" forall (a :: Bool) (b :: Proxy a). forall x. g @(Proxy b) @() x = id @()
-"example5" forall (a :: Type). forall. h @a = id @a
-"example5" forall k (c :: k). forall (x :: Proxy c). id @(Proxy c) x = x
+"example4" forall (a :: Bool) (b :: Proxy a). forall x. g @(Proxy b) @() x = id' @()
+"example5" forall (a :: Type). forall. h @a = id' @a
+"example5" forall k (c :: k). forall (x :: Proxy c). id' @(Proxy c) x = x
#-}
{-# NOINLINE g #-}
@@ -42,4 +46,4 @@ h x = x
{-# RULES "example6" forall a forall. g a forall = () #-}
-- Should generate a warning
-{-# RULES "example7" forall a b. forall (x :: a). id x = x #-}
+{-# RULES "example7" forall a b. forall (x :: a). id' x = x #-}
diff --git a/testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr b/testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr
index f5c06a654a..5dfdb4a570 100644
--- a/testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr
+++ b/testsuite/tests/rename/should_compile/ExplicitForAllRules1.stderr
@@ -1,14 +1,14 @@
-ExplicitForAllRules1.hs:45:11: warning:
+ExplicitForAllRules1.hs:49:11: warning:
Forall'd type variable ‘k’ is not bound in RULE lhs
Orig bndrs: [k, a, b, x]
- Orig lhs: id @ a x
- optimised lhs: id @ a x
+ Orig lhs: id' @ a x
+ optimised lhs: id' @ a x
Forall'd type variable ‘b’ is not bound in RULE lhs
Orig bndrs: [k, a, b, x]
- Orig lhs: id @ a x
- optimised lhs: id @ a x
+ Orig lhs: id' @ a x
+ optimised lhs: id' @ a x
-ExplicitForAllRules1.hs:45:31: warning: [-Wunused-foralls (in -Wextra)]
+ExplicitForAllRules1.hs:49:31: warning: [-Wunused-foralls (in -Wextra)]
Unused quantified type variable ‘b’
in the rule "example7"