[commit: ghc] master: Warn if you use -XTemplateHaskell in stage1 (5bf435b)

git at git.haskell.org git at git.haskell.org
Wed Nov 6 16:21:33 UTC 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5bf435bd01981a65dba7c611cf8da327c8268738/ghc

>---------------------------------------------------------------

commit 5bf435bd01981a65dba7c611cf8da327c8268738
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Nov 6 16:19:34 2013 +0000

    Warn if you use -XTemplateHaskell in stage1
    
    This should really be an error, but we'll just warn for now


>---------------------------------------------------------------

5bf435bd01981a65dba7c611cf8da327c8268738
 compiler/main/DynFlags.hs |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 34d5a47..0116dae 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -3115,10 +3115,10 @@ checkTemplateHaskellOk turn_on
   | otherwise
   = getCurLoc >>= \l -> upd (\d -> d { thOnLoc = l })
 #else
--- In stage 1 we don't know that the RTS has rts_isProfiled,
--- so we simply say "ok".  It doesn't matter because TH isn't
--- available in stage 1 anyway.
-checkTemplateHaskellOk _ = return ()
+-- In stage 1, Template Haskell is simply illegal
+checkTemplateHaskellOk turn_on
+  | turn_on   = addWarn "Template Haskell requires GHC with interpreter support\nPerhaps you are using a stage-1 compiler?"
+  | otherwise = return ()
 #endif
 
 {- **********************************************************************



More information about the ghc-commits mailing list