[project @ 2005-10-26 12:05:03 by simonpj]
authorsimonpj <unknown>
Wed, 26 Oct 2005 12:05:03 +0000 (12:05 +0000)
committersimonpj <unknown>
Wed, 26 Oct 2005 12:05:03 +0000 (12:05 +0000)
commit015aa9723a1e72d7bfe0e82599454bee59f4d472
treed457bf33212aeda337f75f1a9f9688a104bc97b7
parent559295a0cee95f73605a4ec58536a54145201f09
[project @ 2005-10-26 12:05:03 by simonpj]
MERGE TO STABLE

Fix two small Template Haskell bugs.

(1) A bug in the renaming of [d| brackets |].  The problem was
that when we renamed the bracket we messed up the name cache, because
the module was still that of the parent module.  Now we set a fake
module before renaming it.

TH_spliceDecl4 is the test.

(2) An expression splice can in principle mention *any* variable,
so the renamer really has to assume that it does when doing depdendency
analysis.  For example
f = ...
h = ...$(thing "f")...
The renamer had better not put 'h' before 'f', else the type checker
won't find a defn for 'f' in the type envt.

TH_spliceE5 is the test
ghc/compiler/prelude/PrelNames.lhs
ghc/compiler/rename/RnExpr.lhs
ghc/compiler/rename/RnSource.lhs