Wrong error message when using a data type as a class instance head
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.
Trac metadata
Trac field | Value |
---|---|
Version | 8.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |