summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-08-17 14:35:19 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2016-08-17 14:38:52 +0100
commitf352e5cd7bb629fe0ca3b913bfbe7bee43d62f3a (patch)
tree8de467c54198b69cff4e77968365380de75766fc /testsuite
parentefc0372a157eadeee58bbada77c64d53590e04af (diff)
downloadhaskell-f352e5cd7bb629fe0ca3b913bfbe7bee43d62f3a.tar.gz
Keep the bindings local during defaultCallStacks
defaultCallStacks generates evidence bindings for call stacks, but wasn't setting the binding site correctly. As a result they were simply discarded in the case of pattern synonyms, giving rise to Trac #12489. The fix is easy; and I added an ASSERT to catch the error earlier.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/patsyn/should_compile/T12489.hs5
-rw-r--r--testsuite/tests/patsyn/should_compile/all.T1
2 files changed, 6 insertions, 0 deletions
diff --git a/testsuite/tests/patsyn/should_compile/T12489.hs b/testsuite/tests/patsyn/should_compile/T12489.hs
new file mode 100644
index 0000000000..205799b608
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T12489.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE PatternSynonyms, ViewPatterns #-}
+
+module T12489 where
+pattern P :: a -> b
+pattern P a <- (undefined -> a)
diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T
index 78320c7713..7551eb91dd 100644
--- a/testsuite/tests/patsyn/should_compile/all.T
+++ b/testsuite/tests/patsyn/should_compile/all.T
@@ -58,3 +58,4 @@ test('T12094', normal, compile, [''])
test('T11977', normal, compile, [''])
test('T12108', normal, compile, [''])
test('T12484', normal, compile, [''])
+test('T12489', normal, compile, [''])