[GHC] #11112: Error message for accidentally using -> instead of =>
#11112: Error message for accidentally using -> instead of => -------------------------------------+------------------------------------- Reporter: JulesBean | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Consider the following typo: {{{#!hs sort :: Ord s -> [s] -> [s] sort xs = Data.List.sort xs }}} GHC's error message in 7.10 is {{{ Expected a type, but ‘Ord s’ has kind ‘GHC.Prim.Constraint’ In the type signature for ‘Main.sort’: Main.sort :: Ord s -> [s] -> [s] }}} I would suggest that mentioning kinds and GHC.Prim.Constraint is a bit unfriendly in a vanilla session (with ConstraintKinds etc switched off). For comparison, the 6.12 error message was {{{ Class `Ord' used as a type In the type signature for `sort': sort :: Ord a -> [a] -> [a] }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11112> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11112: Error message for accidentally using -> instead of => -------------------------------------+------------------------------------- Reporter: JulesBean | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/tcfail057 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * testcase: => typecheck/should_fail/tcfail057 Comment: In HEAD, the `GHC.Prim.` bit is gone: {{{ Expected a type, but ‘Ord s’ has kind ‘Constraint’ In the type signature for ‘Test.sort’: Test.sort :: Ord s -> [s] -> [s] }}} @JulesBean: what do you think about this error message? The last real change to these error messages was made in commit 8bc6c4a613b5d16118469248cfb8025a5175a174: {{{ Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Fri Oct 19 02:20:12 2012 +0100 Improvements to kind error messages, mainly Also some expected/actual messages are now the right way round }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11112#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11112: Error message for accidentally using -> instead of => -------------------------------------+------------------------------------- Reporter: JulesBean | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/tcfail057 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"5955510e5f57464b1f4f42b510e3558d6e691380/ghc" 5955510e/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="5955510e5f57464b1f4f42b510e3558d6e691380" Improve constraint-used-as-type error msg This responds to Trac #11112 by improving the error message when the kind checker discovers something of kind Constraint used when a type is expected }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11112#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11112: Error message for accidentally using -> instead of => -------------------------------------+------------------------------------- Reporter: JulesBean | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/tcfail057, | typecheck/should_fail/T11112 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * testcase: typecheck/should_fail/tcfail057 => typecheck/should_fail/tcfail057, typecheck/should_fail/T11112 * resolution: => fixed Comment: Good idea! -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11112#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11112: Error message for accidentally using -> instead of => -------------------------------------+------------------------------------- Reporter: JulesBean | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/tcfail057, | typecheck/should_fail/T11112 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by JulesBean): Great! Thanks! -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11112#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC