diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2019-02-21 15:27:17 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-03-09 02:07:53 -0500 |
commit | 1f5cc9dc8aeeafa439d6d12c3c4565ada524b926 (patch) | |
tree | a83c219447dc397524535f408368437422178cba /compiler/rename/RnSource.hs | |
parent | 2762f94dc27cc065dded7755f99c66cba26683dd (diff) | |
download | haskell-1f5cc9dc8aeeafa439d6d12c3c4565ada524b926.tar.gz |
Stop inferring over-polymorphic kinds
Before this patch GHC was trying to be too clever
(Trac #16344); it succeeded in kind-checking this
polymorphic-recursive declaration
data T ka (a::ka) b
= MkT (T Type Int Bool)
(T (Type -> Type) Maybe Bool)
As Note [No polymorphic recursion] discusses, the "solution" was
horribly fragile. So this patch deletes the key lines in
TcHsType, and a wodge of supporting stuff in the renamer.
There were two regressions, both the same: a closed type family
decl like this (T12785b) does not have a CUSK:
type family Payload (n :: Peano) (s :: HTree n x) where
Payload Z (Point a) = a
Payload (S n) (a `Branch` stru) = a
To kind-check the equations we need a dependent kind for
Payload, and we don't get that any more. Solution: make it
a CUSK by giving the result kind -- probably a good thing anyway.
The other case (T12442) was very similar: a close type family
declaration without a CUSK.
Diffstat (limited to 'compiler/rename/RnSource.hs')
-rw-r--r-- | compiler/rename/RnSource.hs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs index f902b0ef07..19f0d315d2 100644 --- a/compiler/rename/RnSource.hs +++ b/compiler/rename/RnSource.hs @@ -2166,9 +2166,7 @@ rnConDecl decl@(ConDeclGADT { con_names = names -- See Note [GADT abstract syntax] in HsDecls (PrefixCon arg_tys, final_res_ty) - new_qtvs = HsQTvs { hsq_ext = HsQTvsRn - { hsq_implicit = implicit_tkvs - , hsq_dependent = emptyNameSet } + new_qtvs = HsQTvs { hsq_ext = implicit_tkvs , hsq_explicit = explicit_tkvs } ; traceRn "rnConDecl2" (ppr names $$ ppr implicit_tkvs $$ ppr explicit_tkvs) |