[GHC] #13971: Misleading "Kind mis-match on LHS of default declaration" error

GHC ghc-devs at haskell.org
Tue Feb 19 12:34:28 UTC 2019


#13971: Misleading "Kind mis-match on LHS of default declaration" error
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |
      Resolution:                    |             Keywords:  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Poor/confusing    |  Unknown/Multiple
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 What's curious is that in other situations, the error message you get for
 mismatched kinds in type family defaults is much clearer. For instance:

 {{{
 λ> class C a where { type T a; type T a = 4 }

 <interactive>:1:40: error:
     • Expected a type, but ‘4’ has kind ‘GHC.Types.Nat’
     • In the type ‘4’
       In the default type instance declaration for ‘T’
       In the class declaration for ‘C’
 }}}

 That is much, much better than the vague "Kind mis-match on LHS of default
 declaration" message we get in the original program. I wonder if GHC can
 arrange for this "Expected a type, but `foo` has kind `Bar`" error message
 to trigger for the original program as well.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13971#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list