
#12792: Wrong error message when using a data type as a class instance head -------------------------------------+------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Keywords: newcomer | Operating System: Unknown/Multiple Architecture: | Type of failure: Incorrect Unknown/Multiple | error/warning at compile-time Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{ Prelude> data List a = Nil | Cons a (List a) Prelude> instance List a <interactive>:3:10: error: • Expected a constraint, but ‘List a’ has kind ‘*’ • In the instance declaration for ‘List a’ Prelude> instance List a where foo = foo <interactive>:2:23: error: ‘foo’ is not a (visible) method of class ‘List’ }}} Clearly, the constraint check should happen before we look at the method names. Happens with 7.10 and 8.0.1 and HEAD. Shouldn’t be hard, marking at newcomer. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12792 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler