Possible type inference regression: "Expected a type, but 'a' has kind 'k0'"
The following program causes GHC HEAD to give an error:
{-# LANGUAGE ScopedTypeVariables #-}
module Foo where
foo (_ :: p a) = [] :: [a]
[1 of 1] Compiling Foo ( kind.hs, kind.o )
kind.hs:4:25: error:
• Expected a type, but ‘a’ has kind ‘k0’
• In an expression type signature: [a]
In the expression: [] :: [a]
In an equation for ‘foo’: foo (_ :: p a) = [] :: [a]
GHC 7.10.1 compiles it fine, and infers the type foo :: p a -> [a].
Trac metadata
| Trac field | Value |
|---|---|
| Version | 8.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |