summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2019-02-16 22:08:46 +0100
committerBen Gamari <ben@smart-cactus.org>2019-02-20 14:46:47 -0500
commitbdc9680cc5fe36f09b263d886e8b4e99d5c84635 (patch)
tree3254684b4a8e73c90c3334404febcae8e3905ea1
parenta481b1991c5ec0c5ff80e05d0af8e1bac8876301 (diff)
downloadhaskell-ghc-8.6-merges.tar.gz
Fix regression incorrectly advertising TH supportghc-8.6-merges
`--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 (cherry picked from commit db4372cda7f6c87e7ad26efe3fca4b3f7f527a48)
-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 95a7122a57..539132653e 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -4084,6 +4084,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