Mon Jan 10 03:03:51 PST 2011 [email protected]
* Do dependency analysis when kind-checking type declarations
This patch fixes Trac #4875. The main point is to do dependency
analysis on type and class declarations, and kind-check them in
dependency order, so as to improve error messages.
This patch means that a few programs that would typecheck before won't
typecheck any more; but before we were (naughtily) going beyond
Haskell 98 without any language-extension flags, and Trac #4875
convinces me that doing so is a Bad Idea.
Here's an example that won't typecheck any more
data T a b = MkT (a b)
type F k = T k Maybe
If you look at T on its own you'd default 'a' to kind *->*;
and then kind-checking would fail on F.
But GHC currently accepts this program beause it looks at
the *occurrences* of T.
M ./compiler/deSugar/DsMeta.hs -1 +1
M ./compiler/hsSyn/HsDecls.lhs -2 +8
M ./compiler/hsSyn/HsUtils.lhs -3 +4
M ./compiler/rename/RnNames.lhs -1 +1
M ./compiler/rename/RnSource.lhs -11 +52
M ./compiler/typecheck/TcInstDcls.lhs -1 +1
M ./compiler/typecheck/TcRnDriver.lhs -5 +5
M ./compiler/typecheck/TcTyClsDecls.lhs -224 +139
M ./compiler/typecheck/TcTyDecls.lhs +37
M ./utils/ghctags/Main.hs -1 +1
View patch online:
http://darcs.haskell.org/cgi-bin/darcsweb.cgi?r=ghc-7.0/ghc;a=darcs_commitdiff;h=20110110110351-1287e-ba2db30c99c190de010335d73df682a596c7ef58.gz
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc