[commit: ghc] ghc-kinds: fix CoreLint with PromotedTypeTyCon (35fdca6)
Julien Cretin
julien at galois.com
Fri Sep 23 15:41:59 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : ghc-kinds
http://hackage.haskell.org/trac/ghc/changeset/35fdca67f7fcbbd2ae76dc7a64fb03b79af47847
>---------------------------------------------------------------
commit 35fdca67f7fcbbd2ae76dc7a64fb03b79af47847
Author: Julien Cretin <ghc at ia0.eu>
Date: Thu Sep 22 12:41:10 2011 +0200
fix CoreLint with PromotedTypeTyCon
>---------------------------------------------------------------
compiler/coreSyn/CoreLint.lhs | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/compiler/coreSyn/CoreLint.lhs b/compiler/coreSyn/CoreLint.lhs
index 5fc9c5c..e58891f 100644
--- a/compiler/coreSyn/CoreLint.lhs
+++ b/compiler/coreSyn/CoreLint.lhs
@@ -665,16 +665,14 @@ lintKind (FunTy k1 k2)
= lintKind k1 >> lintKind k2
lintKind kind@(TyConApp tc kis)
- | isSuperKind kind = panic "lintKind called with BOX"
+ | isPromotedTypeTyCon tc
+ , tyConArity tc == length kis
+ = mapM_ lintKind kis
| isSuperKind tc_kind -- handles *, #, Constraint, etc.
, null kis
= return ()
- | Just n <- isPromotableKind tc_kind -- handles promoted TyCons
- , n == length kis
- = mapM_ lintKind kis
-
| otherwise
= addErrL (hang (ptext (sLit "Malformed kind:")) 2 (quotes (ppr kind)))
where
More information about the Cvs-ghc
mailing list