diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2015-11-27 13:39:18 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-11-29 13:22:14 +0100 |
commit | 85fcd035f73679927a0539d5f6c9b919517365e1 (patch) | |
tree | a7876675987aba3fa0262b003852599b79daaf05 /testsuite | |
parent | 583867b907ddac8c2777e96a5ad8d600ba559569 (diff) | |
download | haskell-85fcd035f73679927a0539d5f6c9b919517365e1.tar.gz |
Implement new -XTemplateHaskellQuotes pragma
Since f16ddcee0c64a92ab911a7841a8cf64e3ac671fd / D876, `ghc-stage1`
supports a subset of `-XTemplateHaskell`, but since we need Cabal to be
able detect (so `.cabal` files can be specified accordingly, see also
GHC #11102 which omits `TemplateHaskell` from `--supported-extensions`)
whether GHC provides full or only partial `-XTemplateHaskell` support,
the proper way to accomplish this is to split off the
quotation/non-splicing `TemplateHaskell` feature-subset into a new
language pragma `TemplateHaskellQuotes`.
Moreover, `-XTemplateHaskellQuotes` is considered safe under SafeHaskell
This addresses #11121
Reviewers: goldfire, ezyang, dterei, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1511
GHC Trac Issues: #11121
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/driver/T4437.hs | 1 | ||||
-rw-r--r-- | testsuite/tests/quotes/T10384.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/quotes/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/safeHaskell/safeLanguage/SafeLang12.stderr | 11 |
4 files changed, 8 insertions, 8 deletions
diff --git a/testsuite/tests/driver/T4437.hs b/testsuite/tests/driver/T4437.hs index 5c087311cc..f58d4c4b8a 100644 --- a/testsuite/tests/driver/T4437.hs +++ b/testsuite/tests/driver/T4437.hs @@ -34,6 +34,7 @@ expectedGhcOnlyExtensions = ["RelaxedLayout", "AlternativeLayoutRule", "AlternativeLayoutRuleTransitional", "OverloadedLabels", + "TemplateHaskellQuotes", "MonadFailDesugaring"] expectedCabalOnlyExtensions :: [String] diff --git a/testsuite/tests/quotes/T10384.hs b/testsuite/tests/quotes/T10384.hs index 773deb061a..c4d9c70ffe 100644 --- a/testsuite/tests/quotes/T10384.hs +++ b/testsuite/tests/quotes/T10384.hs @@ -1,3 +1,3 @@ -{-# LANGUAGE TemplateHaskell, RankNTypes, ScopedTypeVariables #-} +{-# LANGUAGE TemplateHaskellQuotes, RankNTypes, ScopedTypeVariables #-} module A where x = \(y :: forall a. a -> a) -> [|| y ||] diff --git a/testsuite/tests/quotes/all.T b/testsuite/tests/quotes/all.T index a56a50c010..c34a207292 100644 --- a/testsuite/tests/quotes/all.T +++ b/testsuite/tests/quotes/all.T @@ -1,5 +1,5 @@ def f(name, opts): - opts.extra_hc_opts = '-XTemplateHaskell -package template-haskell' + opts.extra_hc_opts = '-XTemplateHaskellQuotes -package template-haskell' setTestOpts(f) diff --git a/testsuite/tests/safeHaskell/safeLanguage/SafeLang12.stderr b/testsuite/tests/safeHaskell/safeLanguage/SafeLang12.stderr index 79ff65c2e9..066b56c4bb 100644 --- a/testsuite/tests/safeHaskell/safeLanguage/SafeLang12.stderr +++ b/testsuite/tests/safeHaskell/safeLanguage/SafeLang12.stderr @@ -1,12 +1,11 @@ -SafeLang12.hs:2:14: Warning: +SafeLang12.hs:2:14: warning: -XTemplateHaskell is not allowed in Safe Haskell; ignoring -XTemplateHaskell -SafeLang12_B.hs:2:14: Warning: +SafeLang12_B.hs:2:14: warning: -XTemplateHaskell is not allowed in Safe Haskell; ignoring -XTemplateHaskell [1 of 3] Compiling SafeLang12_B ( SafeLang12_B.hs, SafeLang12_B.o ) -SafeLang12_B.hs:14:67: - Syntax error on ''Class - Perhaps you intended to use TemplateHaskell - In the Template Haskell quotation ''Class +SafeLang12_B.hs:5:1: error: + Language.Haskell.TH: Can't be safely imported! + The module itself isn't safe. |