#1133: auto-derivation of Enum is disallowed with recursive imports
-------------------------+--------------------------------------------------
Reporter: heatsink | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.6
Severity: normal | Keywords:
Difficulty: Unknown | Testcase:
Architecture: Unknown | Os: Unknown
-------------------------+--------------------------------------------------
A data type with one single-parameter constructor can normally be declared
deriving(Enum) when compiling with -fglasgow-exts. However, when the data
type is also declared in a hs-boot file, this is not accepted. The
following test case demonstrates the problem. The same thing happens if
the 'deriving' clause is also present in the hs-boot file.
{{{
{- file X.hs-boot -}
module X where
newtype X = X Int
{- file X.hs -}
module X where
import {-# SOURCE #-} X
newtype X = X Int deriving(Enum)
}}}
> ghc -c -fglasgow-exts X.hs-boot X.hs
The error occurs in X.hs: {{{Can't make a derived instance of `Enum X'
(`X' has non-nullary constructors)}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1133>
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