Ticket #5769 (closed bug: fixed)
Incorrect 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 trying to compile
{-# LANGUAGE TypeFamilies,
PolyKinds,
ScopedTypeVariables
#-}
convert :: a -> b
convert = undefined
type family Foo a
bar :: forall b a. b -> (Foo a)
bar f = (convert f :: (Foo a))
I get the following error message:
Sandbox.hs:12:10:
Couldn't match type `Foo k a' with `Foo * b'
NB: `Foo' is a type function, and may not be injective
In the expression: (convert f :: Foo a)
In an equation for `bar': bar f = (convert f :: Foo a)
However, this compiles just fine without PolyKinds.
Change History
Note: See
TracTickets for help on using
tickets.
