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

#11548: Absolutely misleading error message on kind error -------------------------------------+------------------------------------- Reporter: mniip | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 8.1 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: -------------------------------------+------------------------------------- {{{#!hs module Bug where import Data.Proxy fun :: Proxy a -> () fun Proxy = () bug :: () bug = fun (Proxy :: Proxy Maybe) }}} {{{#!hs [1 of 1] Compiling Bug ( Bug.hs, Bug.o ) 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) }}} 7.10 gives the appropriate `Couldn't match kind ‘* -> *’ with ‘*’` message. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11548 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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

#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: | -------------------------------------+------------------------------------- Comment (by mniip): Is `Proxy Maybe` even a kind? Unless I'm missing something, in this context it is a type, not a kind. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11548#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: | -------------------------------------+------------------------------------- Comment (by bgamari): A fair point. Yes, "kind" does seem a bit misleading here. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11548#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11548: Absolutely misleading error message on kind error -------------------------------------+------------------------------------- Reporter: mniip | Owner: goldfire 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 goldfire): * owner: => goldfire Comment: Yes, I'm already aware of this issue, but another test case is good. Thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11548#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11548: Absolutely misleading error message on kind error -------------------------------------+------------------------------------- Reporter: mniip | Owner: goldfire 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: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Possibly a duplicate of #11485? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11548#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11548: Absolutely misleading error message on kind error -------------------------------------+------------------------------------- Reporter: mniip | Owner: goldfire Type: bug | Status: new Priority: high | Milestone: Component: Compiler (Type | Version: 8.1 checker) | Resolution: | Keywords: TypeInType 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 simonpj): * keywords: => TypeInType -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11548#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11548: Absolutely misleading error message on kind error -------------------------------------+------------------------------------- Reporter: mniip | Owner: goldfire Type: bug | Status: new Priority: high | Milestone: Component: Compiler (Type | Version: 8.1 checker) | Resolution: | Keywords: TypeInType 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: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): For reference, here is the current error message in GHC 8.0.1/HEAD: {{{ • Couldn't match type ‘* -> *’ with ‘*’ Expected type: Proxy Maybe Actual type: Proxy Maybe Use -fprint-explicit-kinds to see the kind arguments • 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) }}} I think this is much clearer, and doesn't incorrectly label the type as a kind. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11548#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11548: Absolutely misleading error message on kind error -------------------------------------+------------------------------------- Reporter: mniip | Owner: goldfire Type: bug | Status: closed Priority: high | Milestone: 8.0.1 Component: Compiler (Type | Version: 8.0.1-rc1 checker) | Resolution: fixed | Keywords: TypeInType 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): * status: new => closed * version: 8.1 => 8.0.1-rc1 * resolution: => fixed * milestone: => 8.0.1 Comment: This is fixed in 8.0.1. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11548#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC