Skip to content
GitLab
Projects Groups Snippets
  • /
  • 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 5,250
    • Issues 5,250
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 561
    • Merge requests 561
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #7341
Closed
Open
Issue created Oct 17, 2012 by Richard Eisenberg@raeDeveloper

Kind inference does not propagate annotations on associated types

Consider the following:

{-# LANGUAGE KindSignatures, TypeFamilies, PolyKinds #-}

data Proxy a = Proxy

class C a where
  type F (a :: *) :: *
  op :: Proxy a -> Int

instance C [] where
  op _ = 5

When compiled, this code generates a warning saying that F [] is undefined. That's a good warning, but the problem is that the code is erroneous and should not compile. The problem is that the kind annotation on a in the declaration of the family F says that a should have kind *. However, I am permitted to write an instance for [], which does not have kind *.

After playing around with this, I was unable to find a way to cause a type safety error, but the behavior should probably be fixed.

Trac metadata
Trac field Value
Version 7.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
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