diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2020-10-13 15:08:31 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-10-14 12:05:11 -0400 |
commit | bf2411a3c198cb2df93a9e0aa0c3b8297f47058d (patch) | |
tree | d00a401945be17f01bf0b475065b4389489f7db2 /testsuite/tests/deSugar | |
parent | ac300a0d49343e6a558dc36d94fc558f51d43bb2 (diff) | |
download | haskell-bf2411a3c198cb2df93a9e0aa0c3b8297f47058d.tar.gz |
Fix PostfixOperators (#18151)
This fixes a regression introduced in 2b89ca5b850b4097447cc4908cbb0631011ce979
See the new T18151x test case.
Diffstat (limited to 'testsuite/tests/deSugar')
-rw-r--r-- | testsuite/tests/deSugar/should_run/T18151x.hs | 17 | ||||
-rw-r--r-- | testsuite/tests/deSugar/should_run/T18151x.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/deSugar/should_run/all.T | 1 |
3 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/deSugar/should_run/T18151x.hs b/testsuite/tests/deSugar/should_run/T18151x.hs new file mode 100644 index 0000000000..213ca9969f --- /dev/null +++ b/testsuite/tests/deSugar/should_run/T18151x.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE PostfixOperators #-} + +import Control.Exception + +data MyException = MyE + deriving (Show) + +instance Exception MyException + +(#) :: Bool -> Bool -> Bool +(#) = throw MyE + +main = do + r <- try (evaluate (seq (True #) ())) + case r of + Left MyE -> putStrLn "PostfixOperators ok" + Right () -> putStrLn "PostfixOperators broken" diff --git a/testsuite/tests/deSugar/should_run/T18151x.stdout b/testsuite/tests/deSugar/should_run/T18151x.stdout new file mode 100644 index 0000000000..cbd3ad0a5b --- /dev/null +++ b/testsuite/tests/deSugar/should_run/T18151x.stdout @@ -0,0 +1 @@ +PostfixOperators ok diff --git a/testsuite/tests/deSugar/should_run/all.T b/testsuite/tests/deSugar/should_run/all.T index 2df9586b7d..406cb24863 100644 --- a/testsuite/tests/deSugar/should_run/all.T +++ b/testsuite/tests/deSugar/should_run/all.T @@ -65,6 +65,7 @@ test('T11747', normal, compile_and_run, ['-dcore-lint']) test('T12595', normal, compile_and_run, ['']) test('T13285', normal, compile_and_run, ['']) test('T18151', normal, compile_and_run, ['']) +test('T18151x', normal, compile_and_run, ['']) test('T18172', [], ghci_script, ['T18172.script']) test('DsDoExprFailMsg', exit_code(1), compile_and_run, ['']) |