diff options
author | simonpj@microsoft.com <unknown> | 2008-04-04 20:55:56 +0000 |
---|---|---|
committer | simonpj@microsoft.com <unknown> | 2008-04-04 20:55:56 +0000 |
commit | a27c5f77da8b3b3f00f9902b69a504460f234e8c (patch) | |
tree | c67fe72697cd465d532ad6970c0de90c758f0a05 /compiler/rename/RnPat.lhs | |
parent | 3e571a94c03015f2c38c8d2f0f6dfb91c8d4413c (diff) | |
download | haskell-a27c5f77da8b3b3f00f9902b69a504460f234e8c.tar.gz |
Fix Trac #2188: scoping in TH declarations quotes
This patch fixes a rather tiresome issue, namely the fact that
a TH declaration quote *shadows* bindings in outer scopes:
f g = [d| f :: Int
f = g
g :: Int
g = 4 |]
Here, the outer bindings for 'f' (top-level) and 'g' (local)
are shadowed, and the inner bindings for f,g should not be
reported as duplicates. (Remember they are top-level bindings.)
The actual bug was that we'd forgotten to delete 'g' from the
LocalRdrEnv, so the type sig for 'g' was binding to the outer
'g' not the inner one.
Diffstat (limited to 'compiler/rename/RnPat.lhs')
-rw-r--r-- | compiler/rename/RnPat.lhs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rename/RnPat.lhs b/compiler/rename/RnPat.lhs index 0c0d68327b..e56a4ee0d5 100644 --- a/compiler/rename/RnPat.lhs +++ b/compiler/rename/RnPat.lhs @@ -50,7 +50,6 @@ import HsSyn import TcRnMonad import RnEnv import HscTypes ( availNames ) -import RnNames ( getLocalDeclBinders, extendRdrEnvRn ) import RnTypes ( rnHsTypeFVs, mkOpFormRn, mkOpAppRn, mkNegAppRn, checkSectionPrec, mkConOpPatRn ) @@ -111,9 +110,7 @@ matchNameMaker ; return (res, fvs) }}) topRecNameMaker, localRecNameMaker - :: UniqFM (Located Fixity) -- mini fixity env for the names we're about to bind - -- these fixities need to be brought into scope with the names - -> NameMaker + :: MiniFixityEnv -> NameMaker -- topNameMaker and localBindMaker do not check for unused binding localRecNameMaker fix_env |