From 76d5c62aa2a1020abb3a9c74f2b73788474f4804 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Mon, 27 May 2019 23:00:16 -0400 Subject: testsuite: Add test for #16509 --- testsuite/tests/patsyn/should_compile/T16509.hs | 12 ++++++++++++ testsuite/tests/patsyn/should_compile/T16509.script | 1 + testsuite/tests/patsyn/should_compile/all.T | 1 + 3 files changed, 14 insertions(+) create mode 100644 testsuite/tests/patsyn/should_compile/T16509.hs create mode 100644 testsuite/tests/patsyn/should_compile/T16509.script 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']) -- cgit v1.2.1