Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,823
    • Issues 4,823
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 446
    • Merge requests 446
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #12069

Closed
Open
Created May 16, 2016 by takano-akio@takano-akioReporter

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
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking