[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

#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

#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