#3845: compiling template haskell internal error: ... not in scope during type
checking, but it passed the renamer
---------------------------------+------------------------------------------
Reporter: JakeWheat | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.12.1
Keywords: | Difficulty:
Os: Unknown/Multiple | Testcase:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Comment(by simonpj):
Fixed in the HEAD by
{{{
Wed Feb 10 06:51:55 PST 2010 [email protected]
* Keep track of explicit kinding in HsTyVarBndr; plus fix Trac #3845
To print HsTypes correctly we should remember whether the Kind on
a HsTyVarBndr came from type inference, or was put there by the
user. See Note [Printing KindedTyVars] in HsTypes. So instead of
changing a UserTyVar to a KindedTyVar during kind checking, we
simply add a PostTcKind to the UserTyVar.
The change was provoked by Trac #3830, although other changes
mean that #3830 gets a diferent and better error message now.
So this patch is simply doing the Right Thing for the future.
This patch also fixes Trac #3845, which was caused by a *type splice*
not remembering the free *term variables* mentioned in it. Result
was that we build a 'let' when it should have been 'letrec'.
Hence a new FreeVars field in HsSpliceTy.
While I was at it, I got rid of HsSpliceTyOut and use a PostTcKind
on HsSpliceTy instead, just like on the UserTyVar.
M ./compiler/deSugar/DsMeta.hs -6 +7
M ./compiler/hsSyn/Convert.lhs -1 +1
M ./compiler/hsSyn/HsDecls.lhs -1 +1
M ./compiler/hsSyn/HsTypes.lhs -31 +53
M ./compiler/hsSyn/HsUtils.lhs -1 +5
M ./compiler/parser/Parser.y.pp -8 +6
M ./compiler/parser/RdrHsSyn.lhs -4 +2
M ./compiler/rename/RnHsSyn.lhs -3 +2
M ./compiler/rename/RnTypes.lhs -5 +4
M ./compiler/typecheck/TcClassDcl.lhs -1 +2
M ./compiler/typecheck/TcEnv.lhs -6 +3
M ./compiler/typecheck/TcGenDeriv.lhs -1 +2
M ./compiler/typecheck/TcHsType.lhs -45 +14
M ./compiler/typecheck/TcSplice.lhs -7 +5
M ./compiler/typecheck/TcSplice.lhs-boot -1 +2
M ./compiler/typecheck/TcTyClsDecls.lhs -16 +16
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3845#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs