Ticket #1133 (closed bug: fixed)
auto-derivation of Enum is disallowed with recursive imports
| Reported by: | heatsink | Owned by: | simonpj |
|---|---|---|---|
| Priority: | lowest | Milestone: | _|_ |
| Component: | Compiler | Version: | 6.6 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | Unknown |
| Test Case: | T1133, T1133A | Blocked By: | |
| Blocking: | Related Tickets: |
Description
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)
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

