summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2016-10-26 11:19:48 -0400
committerBen Gamari <ben@smart-cactus.org>2016-10-26 11:19:49 -0400
commit23143f60680f78f80762754fe060a3e8c6dc9a01 (patch)
tree6468024b284448e9e9d11d14e42ca9e6b4052e52 /testsuite
parent488a9ed3440fe882ae043ba7f44fed4e84e679ce (diff)
downloadhaskell-23143f60680f78f80762754fe060a3e8c6dc9a01.tar.gz
Refine ASSERT in buildPatSyn for the nullary case.
For a nullary pattern synonym we add an extra void argument to the matcher in order to preserve laziness. The check in buildPatSyn wasn't aware of this special case which was causing the assertion to fail. Reviewers: austin, simonpj, bgamari Reviewed By: simonpj, bgamari Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D2624 GHC Trac Issues: #12746
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/patsyn/should_compile/T12746.hs7
-rw-r--r--testsuite/tests/patsyn/should_compile/T12746A.hs5
-rw-r--r--testsuite/tests/patsyn/should_compile/all.T1
3 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/tests/patsyn/should_compile/T12746.hs b/testsuite/tests/patsyn/should_compile/T12746.hs
new file mode 100644
index 0000000000..4c44c0fda5
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T12746.hs
@@ -0,0 +1,7 @@
+module T12746 where
+
+import T12746A
+
+foo a = case a of
+ Foo -> True
+ _ -> False
diff --git a/testsuite/tests/patsyn/should_compile/T12746A.hs b/testsuite/tests/patsyn/should_compile/T12746A.hs
new file mode 100644
index 0000000000..4cf7b070fb
--- /dev/null
+++ b/testsuite/tests/patsyn/should_compile/T12746A.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE ScopedTypeVariables, PatternSynonyms #-}
+module T12746A where
+
+pattern Foo :: Int
+pattern Foo = 0x00000001
diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T
index 4426c74733..1952672a99 100644
--- a/testsuite/tests/patsyn/should_compile/all.T
+++ b/testsuite/tests/patsyn/should_compile/all.T
@@ -61,3 +61,4 @@ test('T12484', normal, compile, [''])
test('T11987', normal, multimod_compile, ['T11987', '-v0'])
test('T12615', normal, compile, [''])
test('T12698', normal, compile, [''])
+test('T12746', normal, multi_compile, ['T12746', [('T12746A.hs', '-c')],'-v0'])