summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdsko de Vries <edsko@well-typed.com>2013-09-03 12:51:10 +0100
committerEdsko de Vries <edsko@well-typed.com>2013-09-03 14:29:40 +0100
commitbe7f10bb9486462247edb6aae9a3e5f46cfe4908 (patch)
tree4f0640de17831da207aaae6f2edaeb6d3508d482
parent1957fddb9c32e4de001374baad55d9ccf76428f9 (diff)
downloadhaskell-be7f10bb9486462247edb6aae9a3e5f46cfe4908.tar.gz
Fix #7918
-rw-r--r--compiler/rename/RnExpr.lhs6
-rw-r--r--compiler/rename/RnPat.lhs5
-rw-r--r--compiler/rename/RnTypes.lhs4
3 files changed, 10 insertions, 5 deletions
diff --git a/compiler/rename/RnExpr.lhs b/compiler/rename/RnExpr.lhs
index 0ef169085b..23501e3e1a 100644
--- a/compiler/rename/RnExpr.lhs
+++ b/compiler/rename/RnExpr.lhs
@@ -189,8 +189,10 @@ rnExpr (HsSpliceE splice)
rnExpr e@(HsQuasiQuoteE _) = pprPanic "Cant do quasiquotation without GHCi" (ppr e)
#else
rnExpr (HsQuasiQuoteE qq)
- = runQuasiQuoteExpr qq `thenM` \ (L _ expr') ->
- rnExpr expr'
+ = runQuasiQuoteExpr qq `thenM` \ lexpr' ->
+ -- Wrap the result of the quasi-quoter in parens so that we don't
+ -- lose the outermost location set by runQuasiQuote (#7918)
+ rnExpr (HsPar lexpr')
#endif /* GHCI */
---------------------------------------------
diff --git a/compiler/rename/RnPat.lhs b/compiler/rename/RnPat.lhs
index 90a83d6a8e..e7cecf8f3f 100644
--- a/compiler/rename/RnPat.lhs
+++ b/compiler/rename/RnPat.lhs
@@ -416,8 +416,9 @@ rnPatAndThen _ p@(QuasiQuotePat {})
#else
rnPatAndThen mk (QuasiQuotePat qq)
= do { pat <- liftCps $ runQuasiQuotePat qq
- ; L _ pat' <- rnLPatAndThen mk pat
- ; return pat' }
+ -- 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)
diff --git a/compiler/rename/RnTypes.lhs b/compiler/rename/RnTypes.lhs
index a1c4bac25c..c13ea336e4 100644
--- a/compiler/rename/RnTypes.lhs
+++ b/compiler/rename/RnTypes.lhs
@@ -269,7 +269,9 @@ rnHsTyKi _ _ ty@(HsQuasiQuoteTy _) = pprPanic "Can't do quasiquotation without G
rnHsTyKi isType doc (HsQuasiQuoteTy qq)
= ASSERT( isType )
do { ty <- runQuasiQuoteType qq
- ; rnHsType doc (unLoc ty) }
+ -- Wrap the result of the quasi-quoter in parens so that we don't
+ -- lose the outermost location set by runQuasiQuote (#7918)
+ ; rnHsType doc (HsParTy ty) }
#endif
rnHsTyKi isType _ (HsCoreTy ty)