diff options
author | Richard Eisenberg <eir@cis.upenn.edu> | 2014-02-09 12:31:01 -0500 |
---|---|---|
committer | Richard Eisenberg <eir@cis.upenn.edu> | 2014-02-09 12:31:01 -0500 |
commit | 6122efcabe6e08375f69ee19148ba3838c332559 (patch) | |
tree | fee38c7a92ab5918b3c9303cab2d6e21b32a4e29 /testsuite | |
parent | d1dff94c9a82ffeff0bf92d0f90231a639ade59c (diff) | |
download | haskell-6122efcabe6e08375f69ee19148ba3838c332559.tar.gz |
Fix #8759 by not panicking with TH and patsyns.
We should still have pattern synonyms in TH, though.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/th/T8759.hs | 11 | ||||
-rw-r--r-- | testsuite/tests/th/T8759.stderr | 3 | ||||
-rw-r--r-- | testsuite/tests/th/T8759a.hs | 5 | ||||
-rw-r--r-- | testsuite/tests/th/T8759a.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/th/all.T | 2 |
5 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/th/T8759.hs b/testsuite/tests/th/T8759.hs new file mode 100644 index 0000000000..298761a5a4 --- /dev/null +++ b/testsuite/tests/th/T8759.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE TemplateHaskell, PatternSynonyms #-} + +module T8759 where + +import Language.Haskell.TH + +pattern P = () + +$( do info <- reify 'P + reportWarning (show info) + return [] ) diff --git a/testsuite/tests/th/T8759.stderr b/testsuite/tests/th/T8759.stderr new file mode 100644 index 0000000000..3b5474b1ae --- /dev/null +++ b/testsuite/tests/th/T8759.stderr @@ -0,0 +1,3 @@ + +T8759.hs:9:4: + Can't represent pattern synonyms in Template Haskell: P diff --git a/testsuite/tests/th/T8759a.hs b/testsuite/tests/th/T8759a.hs new file mode 100644 index 0000000000..3d8089c2fa --- /dev/null +++ b/testsuite/tests/th/T8759a.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TemplateHaskell, PatternSynonyms #-} + +module T8759a where + +foo = [d| pattern Q = False |] diff --git a/testsuite/tests/th/T8759a.stderr b/testsuite/tests/th/T8759a.stderr new file mode 100644 index 0000000000..ff0fd495df --- /dev/null +++ b/testsuite/tests/th/T8759a.stderr @@ -0,0 +1,4 @@ + +T8759a.hs:5:7: + pattern synonyms not (yet) handled by Template Haskell + pattern Q = False diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 5b064ba2ea..3e88970f51 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -317,3 +317,5 @@ test('T8577', ['T8577', '-v0 ' + config.ghc_th_way_flags]) test('T8633', normal, compile_and_run, ['']) test('T8625', normal, ghci_script, ['T8625.script']) +test('T8759', normal, compile_fail, ['-v0']) +test('T8759a', normal, compile_fail, ['-v0'])
\ No newline at end of file |