Commit 4279665b authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Make -XTemplateHaskell an error in a stage-1 compiler (except with -M)

Fixes Trac #8519
parent 95216e8f
......@@ -3115,10 +3115,18 @@ checkTemplateHaskellOk turn_on
| otherwise
= getCurLoc >>= \l -> upd (\d -> d { thOnLoc = l })
#else
-- In stage 1, Template Haskell is simply illegal
-- In stage 1, Template Haskell is simply illegal, except with -M
-- We don't bleat with -M because there's no problem with TH there,
-- and in fact GHC's build system does ghc -M of the DPH libraries
-- with a stage1 compiler
checkTemplateHaskellOk turn_on
| turn_on = addWarn "Template Haskell requires GHC with interpreter support\n Perhaps you are using a stage-1 compiler?"
| turn_on = do dfs <- liftEwM getCmdLineState
case ghcMode dfs of
MkDepend -> return ()
_ -> addErr msg
| otherwise = return ()
where
msg = "Template Haskell requires GHC with interpreter support\n Perhaps you are using a stage-1 compiler?"
#endif
{- **********************************************************************
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment