diff options
author | simonpj@microsoft.com <unknown> | 2011-01-10 11:03:51 +0000 |
---|---|---|
committer | simonpj@microsoft.com <unknown> | 2011-01-10 11:03:51 +0000 |
commit | 6ea06bbf08517d9805feb82df65cc56ecbaf23a4 (patch) | |
tree | 0f7d4d11bda62cbe37f3f5842e233e369071c691 /utils | |
parent | 338cac018258e0c5540e18e0efe7dc84dfce8c86 (diff) | |
download | haskell-6ea06bbf08517d9805feb82df65cc56ecbaf23a4.tar.gz |
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.
Diffstat (limited to 'utils')
-rw-r--r-- | utils/ghctags/Main.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/ghctags/Main.hs b/utils/ghctags/Main.hs index 118bcac0be..a25537ee99 100644 --- a/utils/ghctags/Main.hs +++ b/utils/ghctags/Main.hs @@ -251,7 +251,7 @@ boundValues mod group = , bind <- bagToList binds , x <- boundThings mod bind ] _other -> error "boundValues" - tys = [ n | ns <- map hsTyClDeclBinders (hs_tyclds group) + tys = [ n | ns <- map hsTyClDeclBinders (concat (hs_tyclds group)) , n <- map found ns ] fors = concat $ map forBound (hs_fords group) where forBound lford = case unLoc lford of |