#2126: Misleading error message for newtype with no constructors
------------------------+---------------------------------------------------
Reporter: tim | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler (Type checker)
Version: 6.8.1 | Severity: trivial
Keywords: | Testcase:
Architecture: Unknown | Os: Unknown
------------------------+---------------------------------------------------
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...
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2126>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs