diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2013-11-06 16:21:05 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2013-11-06 16:21:05 +0000 |
commit | bf3b29323d69b2c6f073885fb896dd4a5c346c02 (patch) | |
tree | 510f1c4a46dd368985566226c7055c9738afa0b5 /compiler/rename/RnPat.lhs | |
parent | 5bf435bd01981a65dba7c611cf8da327c8268738 (diff) | |
download | haskell-bf3b29323d69b2c6f073885fb896dd4a5c346c02.tar.gz |
Tidy up the error messages we get from TH in stage1 (Trac #8312)
Instead of panic-ing we now give a sensible message.
There is quite a bit of refactoring here too, removing
several #ifdef GHCI things
Diffstat (limited to 'compiler/rename/RnPat.lhs')
-rw-r--r-- | compiler/rename/RnPat.lhs | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/compiler/rename/RnPat.lhs b/compiler/rename/RnPat.lhs index 16f94fe5a8..28879d301e 100644 --- a/compiler/rename/RnPat.lhs +++ b/compiler/rename/RnPat.lhs @@ -39,10 +39,8 @@ module RnPat (-- main entry points -- ENH: thin imports to only what is necessary for patterns import {-# SOURCE #-} RnExpr ( rnLExpr ) -#ifdef GHCI import {-# SOURCE #-} RnSplice ( rnSplicePat ) import {-# SOURCE #-} TcSplice ( runQuasiQuotePat ) -#endif /* GHCI */ #include "HsVersions.h" @@ -424,22 +422,15 @@ rnPatAndThen mk (TuplePat pats boxed _) ; pats' <- rnLPatsAndThen mk pats ; return (TuplePat pats' boxed placeHolderType) } -#ifndef GHCI -rnPatAndThen _ p@(SplicePat {}) - = pprPanic "Can't do SplicePat without GHCi" (ppr p) -rnPatAndThen _ p@(QuasiQuotePat {}) - = pprPanic "Can't do QuasiQuotePat without GHCi" (ppr p) -#else rnPatAndThen _ (SplicePat splice) = do { -- XXX How to deal with free variables? - (pat, _) <- liftCps $ rnSplicePat splice + ; (pat, _) <- liftCps $ rnSplicePat splice ; return pat } rnPatAndThen mk (QuasiQuotePat qq) = do { pat <- liftCps $ runQuasiQuotePat qq -- Wrap the result of the quasi-quoter in parens so that we don't -- lose the outermost location set by runQuasiQuote (#7918) ; rnPatAndThen mk (ParPat pat) } -#endif /* GHCI */ rnPatAndThen _ pat = pprPanic "rnLPatAndThen" (ppr pat) |