Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,970
    • Issues 4,970
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 461
    • Merge requests 461
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #1133
Closed
Open
Created Feb 05, 2007 by red5_2@hotmail.com@trac-red5_2

auto-derivation of Enum is disallowed with recursive imports

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)

Trac metadata
Trac field Value
Version 6.6
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking