summaryrefslogtreecommitdiff
path: root/testsuite/tests/patsyn
diff options
context:
space:
mode:
authorDr. ERDI Gergo <gergo@erdi.hu>2014-10-21 20:51:35 +0800
committerDr. ERDI Gergo <gergo@erdi.hu>2014-11-01 19:14:17 +0800
commite5ba36080d08791f44e3bed37721f702e242af96 (patch)
treea902616e3c5ec60a828133bb6576ceafde262254 /testsuite/tests/patsyn
parent65346865f1177fc89767de09604376ffea45bd4d (diff)
downloadhaskell-e5ba36080d08791f44e3bed37721f702e242af96.tar.gz
rnMethodBind: reject pattern synonyms in instance definitions (fixes #9705)
Diffstat (limited to 'testsuite/tests/patsyn')
-rw-r--r--testsuite/tests/patsyn/should_fail/T9705.hs3
-rw-r--r--testsuite/tests/patsyn/should_fail/T9705.stderr4
-rw-r--r--testsuite/tests/patsyn/should_fail/all.T1
3 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/tests/patsyn/should_fail/T9705.hs b/testsuite/tests/patsyn/should_fail/T9705.hs
new file mode 100644
index 0000000000..54d1d00e7f
--- /dev/null
+++ b/testsuite/tests/patsyn/should_fail/T9705.hs
@@ -0,0 +1,3 @@
+{-# LANGUAGE PatternSynonyms #-}
+class C a where
+ pattern P = ()
diff --git a/testsuite/tests/patsyn/should_fail/T9705.stderr b/testsuite/tests/patsyn/should_fail/T9705.stderr
new file mode 100644
index 0000000000..d9a3a495c9
--- /dev/null
+++ b/testsuite/tests/patsyn/should_fail/T9705.stderr
@@ -0,0 +1,4 @@
+
+T9705.hs:3:5:
+ Pattern synonyms not allowed in instance declarations
+ pattern P = ()
diff --git a/testsuite/tests/patsyn/should_fail/all.T b/testsuite/tests/patsyn/should_fail/all.T
index bff6bdf8c2..298f23bf2a 100644
--- a/testsuite/tests/patsyn/should_fail/all.T
+++ b/testsuite/tests/patsyn/should_fail/all.T
@@ -6,3 +6,4 @@ test('T8961', normal, multimod_compile_fail, ['T8961',''])
test('as-pattern', normal, compile_fail, [''])
test('T9161-1', normal, compile_fail, [''])
test('T9161-2', normal, compile_fail, [''])
+test('T9705', normal, compile_fail, [''])