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,245
    • Issues 5,245
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 571
    • Merge requests 571
  • 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
  • #7524
Closed
Open
Issue created Dec 23, 2012 by Richard Eisenberg@raeDeveloper

Erroneous repeated kind variable in conflicting type family instance error message

Consider the following code:

{-# LANGUAGE TypeFamilies, PolyKinds #-}

type family F (a :: k1) (b :: k2)
type instance F a a = Int
type instance F a b = Bool

GHC correctly complains that these instances overlap. The error message is this:

/Users/rae/temp/Scratch.hs:4:15:
    Conflicting family instance declarations:
      F k k a a -- Defined at /Users/rae/temp/Scratch.hs:4:15
      F k k a b -- Defined at /Users/rae/temp/Scratch.hs:5:15

The problem is the repeated k kind variable in the second line, above. The type variables a and b can have different kinds, so the kind variables should be, say, k1 and k2. (The repeated k variable in the first line is correct.)

While I realize I have been playing around most recently in the type family code, I think this problem is further up the chain than where I've been writing.... it would seem to be that whatever code generates kind variables is generating multiple ones with the same name (but hopefully different Uniques!). This behavior is the same in 7.6.1 as it is in HEAD (7.7.20121221).

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