[commit: ghc] master: Suggest TemplateHaskell after encountering a naked top-level expression (0f2a20b)

git at git.haskell.org git at git.haskell.org
Thu Dec 5 08:31:24 UTC 2013


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/0f2a20bc882a918d39219b045a8db1ac7d9354fc/ghc

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

commit 0f2a20bc882a918d39219b045a8db1ac7d9354fc
Author: Patrick Palka <patrick at parcs.ath.cx>
Date:   Fri Nov 15 13:57:26 2013 -0500

    Suggest TemplateHaskell after encountering a naked top-level expression
    
    Helps fix #7396


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

0f2a20bc882a918d39219b045a8db1ac7d9354fc
 compiler/rename/RnSource.lhs |    1 +
 1 file changed, 1 insertion(+)

diff --git a/compiler/rename/RnSource.lhs b/compiler/rename/RnSource.lhs
index 90175c0..624c3b6 100644
--- a/compiler/rename/RnSource.lhs
+++ b/compiler/rename/RnSource.lhs
@@ -1475,6 +1475,7 @@ add gp loc (SpliceD splice@(SpliceDecl _ flag)) ds
        ; return (gp, Just (splice, ds)) }
   where
     badImplicitSplice = ptext (sLit "Parse error: naked expression at top level")
+                     $$ ptext (sLit "Perhaps you intended to use TemplateHaskell")
 
 add gp _ (QuasiQuoteD qq) ds            -- Expand quasiquotes
   = do { ds' <- runQuasiQuoteDecl qq



More information about the ghc-commits mailing list