summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2019-02-16 22:08:46 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-02-23 21:43:58 -0500
commitee284b854e514685036dc21a1ee61241c76d14b5 (patch)
tree085d8ea2b95729c6706cd023680e3f27e0ec45e9
parente61f6e35e2fffb1e82e9559852481010fe84d8d3 (diff)
downloadhaskell-ee284b854e514685036dc21a1ee61241c76d14b5.tar.gz
Fix regression incorrectly advertising TH support
`--supported-languages` must only advertise language extensions which are supported by the compiler in order for tooling such as Cabal relying on this signalling not to behave incorrectly. Fixes #16331
-rw-r--r--compiler/main/DynFlags.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index f929d98cca..dca692ec83 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -4290,6 +4290,14 @@ supportedExtensions :: [String]
supportedExtensions = concatMap toFlagSpecNamePair xFlags
where
toFlagSpecNamePair flg
+#if !defined(GHCI)
+ -- IMPORTANT! Make sure that `ghc --supported-extensions` omits
+ -- "TemplateHaskell"/"QuasiQuotes" when it's known not to work out of the
+ -- box. See also GHC #11102 and #16331 for more details about
+ -- the rationale
+ | flagSpecFlag flg == LangExt.TemplateHaskell = [noName]
+ | flagSpecFlag flg == LangExt.QuasiQuotes = [noName]
+#endif
| otherwise = [name, noName]
where
noName = "No" ++ name