Misleading error message for newtype with no constructors
Further adventures in error message pedantry! If I compile this module:
module Foo where
newtype X
I get:
$ ghc -c Foo.hs
Foo.hs:3:0:
`X' has no constructors (-XEmptyDataDecls permits this)
In the newtype declaration for `X'
Naively, I do what it suggests:
$ ghc -c Foo.hs -XEmptyDataDecls
Foo.hs:3:0:
A newtype must have exactly one constructor, but `X' has none
In the newtype declaration for `X'
It would be better to just print the second error message even when the user doesn't pass -XEmptyDataDecls
, and not lead them down a maze of twisty little passages...
Trac metadata
Trac field | Value |
---|---|
Version | 6.8.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Type checker) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | Unknown |
Architecture | Unknown |