#10561 closed bug (fixed)
"deriving (Functor)" on a polykinded type produces ill-kinded instance
Reported by: | rwbarton | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 8.0.1 |
Component: | Compiler | Version: | 7.11 |
Keywords: | deriving | Cc: | RyanGlScott |
Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
Type of failure: | None/Unknown | Test Case: | deriving/should_compile/T10561 |
Blocked By: | Blocking: | ||
Related Tickets: | Differential Rev(s): | ||
Wiki Page: |
Description
Arose in #10524, and new since 7.10.
rwbarton@morphism:/tmp$ ~/ghc/inplace/bin/ghc-stage2 --interactive GHCi, version 7.11.20150615: http://www.haskell.org/ghc/ :? for help Prelude> :set -XPolyKinds -XDeriveFunctor -ddump-deriv -fprint-explicit-kinds Prelude> newtype Compose f g a = Compose (f (g a)) deriving Functor ==================== Derived instances ==================== Derived instances: instance forall (k_and :: BOX) (f_ane :: k_and -> *) (g_anf :: * -> k_and). (GHC.Base.Functor f_ane, GHC.Base.Functor g_anf) => GHC.Base.Functor (Ghci1.Compose k_and * f_ane g_anf) where GHC.Base.fmap f_ang (Ghci1.Compose a1_anh) = Ghci1.Compose (GHC.Base.fmap (GHC.Base.fmap f_ang) a1_anh) Generic representation: Generated datatypes for meta-information: Representation types: Prelude> :i GHC.Base.Functor class Functor (f :: * -> *) where [...]
The context (GHC.Base.Functor f_ane, GHC.Base.Functor g_anf)
is ill-kinded except when k_and = *
.
Change History (6)
comment:1 Changed 5 years ago by
Cc: | RyanGlScott added |
---|
comment:2 Changed 5 years ago by
comment:3 Changed 5 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Test Case: | → deriving/should_compile/T10561 |
This patch makes GHC complain before generating ill-kinded code via deriving
.
#10524 contains the remaining open issue.
comment:4 Changed 4 years ago by
Milestone: | → 8.0.1 |
---|
comment:6 Changed 2 years ago by
Keywords: | deriving added |
---|
Note: See
TracTickets for help on using
tickets.
In 9a348640c5ddd63c3385d3722fb3ade38013a148/ghc: