[GHC] #11548: Absolutely misleading error message on kind error

GHC ghc-devs at haskell.org
Sat Feb 6 11:15:30 UTC 2016


#11548: Absolutely misleading error message on kind error
-------------------------------------+-------------------------------------
        Reporter:  mniip             |                Owner:
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:
       Component:  Compiler (Type    |              Version:  8.1
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by bgamari):

 * component:  Compiler => Compiler (Type checker)


Comment:

 Note that if you pass `-fprint-explicit-kinds` the error is a bit better
 (although arguably still not as clear as 7.10's error),

 {{{
 Bug.hs:9:12: error:
     • Expected kind ‘Proxy * Maybe’,
         but ‘Data.Proxy.Proxy :: Proxy Maybe’ has kind ‘Proxy
                                                           (* -> *) Maybe’
     • In the first argument of ‘fun’, namely ‘(Proxy :: Proxy Maybe)’
       In the expression: fun (Proxy :: Proxy Maybe)
       In an equation for ‘bug’: bug = fun (Proxy :: Proxy Maybe)
 }}}

 Of course, this isn't a great situation; surely the compiler can see that
 the types as printed are indistinguishable and it should therefore
 providing kinds as well. I'm not certain of this, but I suspect Richard is
 already aware of this issue.

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


More information about the ghc-tickets mailing list