summaryrefslogtreecommitdiff
path: root/compiler/rename
diff options
context:
space:
mode:
authorJose Pedro Magalhaes <jpm@cs.uu.nl>2011-05-05 08:11:52 +0200
committerJose Pedro Magalhaes <jpm@cs.uu.nl>2011-05-05 08:11:52 +0200
commitea94a66d93047a9b0cd4532645eb1e9be04888e1 (patch)
tree3bbc0136edc46b047a8d54b26d0646e09fb71f89 /compiler/rename
parentffabe3acb2d30be0c8e89e139f5bca7a1eb900f6 (diff)
parent51fd4a1db15971e8eb46a2d665dc3f1572b95653 (diff)
downloadhaskell-ea94a66d93047a9b0cd4532645eb1e9be04888e1.tar.gz
Merge branch 'master' of http://darcs.haskell.org/ghc into ghc-generics
Fixed conflicts: compiler/iface/IfaceSyn.lhs compiler/typecheck/TcSMonad.lhs
Diffstat (limited to 'compiler/rename')
-rw-r--r--compiler/rename/RnExpr.lhs21
1 files changed, 18 insertions, 3 deletions
diff --git a/compiler/rename/RnExpr.lhs b/compiler/rename/RnExpr.lhs
index b3458dbc80..46eef670f2 100644
--- a/compiler/rename/RnExpr.lhs
+++ b/compiler/rename/RnExpr.lhs
@@ -841,9 +841,24 @@ rnParallelStmts ctxt segs thing_inside
lookupStmtName :: HsStmtContext Name -> Name -> RnM (HsExpr Name, FreeVars)
-- Like lookupSyntaxName, but ListComp/PArrComp are never rebindable
-lookupStmtName ListComp n = return (HsVar n, emptyFVs)
-lookupStmtName PArrComp n = return (HsVar n, emptyFVs)
-lookupStmtName _ n = lookupSyntaxName n
+-- Neither is ArrowExpr, which has its own desugarer in DsArrows
+lookupStmtName ctxt n
+ = case ctxt of
+ ListComp -> not_rebindable
+ PArrComp -> not_rebindable
+ ArrowExpr -> not_rebindable
+ PatGuard {} -> not_rebindable
+
+ DoExpr -> rebindable
+ MDoExpr -> rebindable
+ MonadComp -> rebindable
+ GhciStmt -> rebindable -- I suppose?
+
+ ParStmtCtxt c -> lookupStmtName c n -- Look inside to
+ TransStmtCtxt c -> lookupStmtName c n -- the parent context
+ where
+ rebindable = lookupSyntaxName n
+ not_rebindable = return (HsVar n, emptyFVs)
\end{code}
Note [Renaming parallel Stmts]