import RnHsSyn
import TcRnMonad
import RnEnv
+import HscTypes ( availNames )
+import OccName ( plusOccEnv )
import RnNames ( getLocalDeclBinders, extendRdrEnvRn )
import RnTypes ( rnHsTypeFVs, rnLPat, rnOverLit, rnPatsAndThen, rnLit,
mkOpFormRn, mkOpAppRn, mkNegAppRn, checkSectionPrec,
fvExpr `plusFV` fvRbinds)
rnExpr (ExprWithTySig expr pty)
- = rnLExpr expr `thenM` \ (expr', fvExpr) ->
- rnHsTypeFVs doc pty `thenM` \ (pty', fvTy) ->
- returnM (ExprWithTySig expr' pty', fvExpr `plusFV` fvTy)
+ = do { (pty', fvTy) <- rnHsTypeFVs doc pty
+ ; (expr', fvExpr) <- bindSigTyVarsFV (hsExplicitTvs pty') $
+ rnLExpr expr
+ ; return (ExprWithTySig expr' pty', fvExpr `plusFV` fvTy) }
where
doc = text "In an expression type signature"
-- confuse the Names for the current module.
-- By using a pretend module, thFAKE, we keep them safely out of the way.
- ; names <- getLocalDeclBinders gbl_env1 group
+ ; avails <- getLocalDeclBinders gbl_env1 group
+ ; let names = concatMap availNames avails
; let new_occs = map nameOccName names
trimmed_rdr_env = hideSomeUnquals (tcg_rdr_env gbl_env) new_occs
- ; rdr_env' <- extendRdrEnvRn trimmed_rdr_env names
+ ; rdr_env' <- extendRdrEnvRn trimmed_rdr_env avails
-- In this situation we want to *shadow* top-level bindings.
-- foo = 1
-- bar = [d| foo = 1|]