summaryrefslogtreecommitdiff
path: root/testsuite/tests/patsyn
diff options
context:
space:
mode:
authorDr. ERDI Gergo <gergo@erdi.hu>2014-12-17 22:09:06 +0800
committerSimon Peyton Jones <simonpj@microsoft.com>2015-01-09 15:48:15 +0000
commit5830fc449af6b2c0ef5be409fd3457114ae938ca (patch)
tree1c5aaec0bcfc183c9533942c9e0190686c216b12 /testsuite/tests/patsyn
parent678df4c2930c4aef61b083edb0f5c4d8c8914a76 (diff)
downloadhaskell-5830fc449af6b2c0ef5be409fd3457114ae938ca.tar.gz
Pattern synonym names need to be in scope before renaming bindings (#9889)
I did a bit of refactoring at the same time, needless to say
Diffstat (limited to 'testsuite/tests/patsyn')
-rw-r--r--testsuite/tests/patsyn/should_compile/T9889.hs6
-rw-r--r--testsuite/tests/patsyn/should_compile/all.T1
-rw-r--r--testsuite/tests/patsyn/should_fail/local.stderr4
-rw-r--r--testsuite/tests/patsyn/should_run/ghci.stdout2
4 files changed, 10 insertions, 3 deletions
diff --git a/testsuite/tests/patsyn/should_compile/T9889.hs b/testsuite/tests/patsyn/should_compile/T9889.hs
new file mode 100644
index 0000000000..27b219f6ff
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T9889.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE PatternSynonyms #-}
+module ShouldCompile where
+
+pattern Id x = x
+
+Id x = True
diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T
index d5d5eed1ce..086875ffa4 100644
--- a/testsuite/tests/patsyn/should_compile/all.T
+++ b/testsuite/tests/patsyn/should_compile/all.T
@@ -20,3 +20,4 @@ test('T8968-2', normal, compile, [''])
test('T8968-3', expect_broken(9953), compile, [''])
test('ImpExp_Imp', [extra_clean(['ImpExp_Exp.hi', 'ImpExp_Exp.o'])], multimod_compile, ['ImpExp_Imp', '-v0'])
test('T9857', normal, compile, [''])
+test('T9889', normal, compile, [''])
diff --git a/testsuite/tests/patsyn/should_fail/local.stderr b/testsuite/tests/patsyn/should_fail/local.stderr
index a9a8d01af9..c570809640 100644
--- a/testsuite/tests/patsyn/should_fail/local.stderr
+++ b/testsuite/tests/patsyn/should_fail/local.stderr
@@ -1,4 +1,4 @@
local.hs:7:5:
- Illegal pattern synonym declaration
- Pattern synonym declarations are only valid in the top-level scope
+ Illegal pattern synonym declaration for ā€˜Pā€™
+ Pattern synonym declarations are only valid at top level
diff --git a/testsuite/tests/patsyn/should_run/ghci.stdout b/testsuite/tests/patsyn/should_run/ghci.stdout
index 796aa72d61..e434de3dd6 100644
--- a/testsuite/tests/patsyn/should_run/ghci.stdout
+++ b/testsuite/tests/patsyn/should_run/ghci.stdout
@@ -1,3 +1,3 @@
-pattern Single :: t -> [t] -- Defined at <interactive>:4:9
+pattern Single :: t -> [t] -- Defined at <interactive>:4:1
foo :: [Bool] -> [Bool]
[False]