id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
7524,Erroneous repeated kind variable in conflicting type family instance error message,goldfire,,"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).",bug,closed,normal,,Compiler,7.7,fixed,,,Unknown/Multiple,Unknown/Multiple,Incorrect warning at compile-time,Unknown,polykinds/T7524,,,#7587
