diff options
-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']) |