Ticket #5770 (closed bug: fixed)
Non-sensical error message when compiling with PolyKinds and a type family
| Reported by: | goldfire | Owned by: | dreixel |
|---|---|---|---|
| Priority: | high | Milestone: | 7.6.1 |
| Component: | Compiler (Type checker) | Version: | 7.4.1-rc1 |
| Keywords: | PolyKinds | Cc: | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | GHC rejects valid program | Difficulty: | Unknown |
| Test Case: | polykinds/T5770 | Blocked By: | |
| Blocking: | Related Tickets: | #5717 |
Description
When I compile the following code:
{-# LANGUAGE TypeFamilies,
PolyKinds,
ScopedTypeVariables
#-}
convert :: a -> b
convert = undefined
type family Foo a
type instance Foo Int = Bool
bar :: forall a b c dummya. (b -> c) -> ((Foo a) -> c)
bar f = (convert f :: (Foo a) -> c)
I get the following error message:
Sandbox.hs:13:34:
Kind mis-match
Expected kind `OpenKind', but `c' has kind `b'
In an expression type signature: (Foo a) -> c
In the expression: (convert f :: (Foo a) -> c)
In an equation for `bar': bar f = (convert f :: (Foo a) -> c)
This error message does not make sense, for 'b' isn't a kind. It is interesting to note that removing dummya from the list of declared type variables changes the error to a GHC panic.
Change History
Note: See
TracTickets for help on using
tickets.
