summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-12-05 13:17:35 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2016-12-05 17:40:03 +0000
commit6305674f310633d159a4df4e2e0d033a698599d1 (patch)
tree00911db2cf500aa0357c5c799fe6b1a93bebccea /testsuite/tests/rename
parent517d03e41b4f5c144d1ad684539340421be2be2a (diff)
downloadhaskell-6305674f310633d159a4df4e2e0d033a698599d1.tar.gz
Fix used-variable calculation (Trac #12548)
The used-variable calculation for pattern synonyms is a little tricky, for reasons described in RnBinds Note [Pattern synonym builders don't yield dependencies] It was right semantically, but the "unused-variable warning" was wrong, which led to Trac #12548.
Diffstat (limited to 'testsuite/tests/rename')
-rw-r--r--testsuite/tests/rename/should_compile/T12548.hs12
-rw-r--r--testsuite/tests/rename/should_compile/all.T1
2 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/rename/should_compile/T12548.hs b/testsuite/tests/rename/should_compile/T12548.hs
new file mode 100644
index 0000000000..c19a7d2a3c
--- /dev/null
+++ b/testsuite/tests/rename/should_compile/T12548.hs
@@ -0,0 +1,12 @@
+{-# OPTIONS_GHC -Wunused-binds #-}
+{-# LANGUAGE PatternSynonyms #-}
+
+module Foo (pattern P) where
+
+-- x is used!!
+x :: Int
+x = 0
+
+pattern P :: Int
+pattern P <- _ where
+ P = x
diff --git a/testsuite/tests/rename/should_compile/all.T b/testsuite/tests/rename/should_compile/all.T
index 106ba0a2a9..90d955b7c8 100644
--- a/testsuite/tests/rename/should_compile/all.T
+++ b/testsuite/tests/rename/should_compile/all.T
@@ -244,3 +244,4 @@ test('T12127',
['T12127', '-v0'])
test('T12533', normal, compile, [''])
test('T12597', normal, compile, [''])
+test('T12548', normal, compile, [''])