Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 3,617
    • Issues 3,617
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 203
    • Merge Requests 203
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Security & Compliance
    • Security & Compliance
    • Dependency List
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #7524

Closed
Open
Opened Dec 23, 2012 by Richard Eisenberg@rae
  • Report abuse
  • New issue
Report abuse New issue

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

Related issues

  • Discussion
  • Designs
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
4
Labels
bug error messages P::normal Trac import
Assign labels
  • View project labels
Reference: ghc/ghc#7524