[GHC] #9000: Kind checking fails when using PolyKinds
GHC
ghc-devs at haskell.org
Tue Apr 15 23:14:48 UTC 2014
#9000: Kind checking fails when using PolyKinds
-------------------------------------+-------------------------------------
Reporter: facundo.dominguez | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 7.8.2
checker) | Operating System: Linux
Keywords: | Type of failure: GHC rejects
Architecture: x86_64 (amd64) | valid program
Difficulty: Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: |
-------------------------------------+-------------------------------------
GHC HEAD and earlier versions are failing on the following program:
{{{
{-# LANGUAGE PolyKinds #-}
import GHC.Exts(Any)
f = (undefined :: a -> m a) :: Any -> Any Any
}}}
{{{
../tmp/test-polykinds.hs:3:6:
Couldn't match kind ‘k1’ with ‘*’
‘k1’ is a rigid type variable bound by
an expression type signature: Any -> Any Any
at ../tmp/test-polykinds.hs:3:5
Expected type: Any -> Any Any
Actual type: Any -> m0 Any
In the expression: (undefined :: a -> m a) :: Any -> Any Any
In an equation for ‘f’:
f = (undefined :: a -> m a) :: Any -> Any Any
}}}
Rewriting the program as follows has compilation succeed.
{{{
f = (undefined :: a -> m a) `asTypeOf` (undefined :: Any -> Any Any)
}}}
And removing the {{{PolyKinds}}} extension also has compilation succeed.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9000>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list