diff options
author | Ben Gamari <ben@smart-cactus.org> | 2019-05-27 23:00:16 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-06-09 18:46:08 -0400 |
commit | 8a48a8a4e2f14f7f01aa1d4cf249420c908edb73 (patch) | |
tree | 32d3d6793beff51e4ce3c1e29725bb57cbd365e8 /testsuite/tests/patsyn | |
parent | ed20412a8ce7578d073461892c9643591c6993a5 (diff) | |
download | haskell-8a48a8a4e2f14f7f01aa1d4cf249420c908edb73.tar.gz |
testsuite: Add test for #16509
Diffstat (limited to 'testsuite/tests/patsyn')
-rw-r--r-- | testsuite/tests/patsyn/should_compile/T16509.hs | 12 | ||||
-rw-r--r-- | testsuite/tests/patsyn/should_compile/T16509.script | 1 | ||||
-rw-r--r-- | testsuite/tests/patsyn/should_compile/all.T | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/testsuite/tests/patsyn/should_compile/T16509.hs b/testsuite/tests/patsyn/should_compile/T16509.hs new file mode 100644 index 0000000000..b848811119 --- /dev/null +++ b/testsuite/tests/patsyn/should_compile/T16509.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE PatternSynonyms #-} +{-# LANGUAGE ViewPatterns #-} + +module PatternPanic where + +pattern TestPat :: (Int, Int) +pattern TestPat <- (isSameRef -> True, 0) + +isSameRef :: Int -> Bool +isSameRef e | 0 <- e = True +isSameRef _ = False + diff --git a/testsuite/tests/patsyn/should_compile/T16509.script b/testsuite/tests/patsyn/should_compile/T16509.script new file mode 100644 index 0000000000..fd4714a9b5 --- /dev/null +++ b/testsuite/tests/patsyn/should_compile/T16509.script @@ -0,0 +1 @@ +:load T16509.hs diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T index 2ac343f635..15369b657e 100644 --- a/testsuite/tests/patsyn/should_compile/all.T +++ b/testsuite/tests/patsyn/should_compile/all.T @@ -77,5 +77,6 @@ test('T14326', normal, compile, ['']) test('T14394', normal, ghci_script, ['T14394.script']) test('T14552', normal, compile, ['']) test('T14498', normal, compile, ['']) +test('T16509', expect_broken(16509), ghci_script, ['T16509.script']) test('T16682', [extra_files(['T16682.hs', 'T16682a.hs'])], multimod_compile, ['T16682', '-v0 -fwarn-incomplete-patterns -fno-code']) |