Ticket #2612 (closed bug: duplicate)

Opened 5 years ago

Last modified 5 years ago

deriving Data.Typeable on phantom newtypes does not report that DeriveDataTypeable is needed

Reported by: guest Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.9
Keywords: Cc: tom.davie@…
Operating System: MacOS X Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

newtype Foo x = Foo deriving (Typeable)

reports the rather cryptic error message:

Can't make a derived instance of `Typeable (Foo x)'

(even with cunning newtype deriving:)

In the newtype declaration for `Foo'

When newtype is replaced with data, this much more useful error message is given:

Can't make a derived instance of `Typeable (Foo x)'

(You need -XDeriveDataTypeable to derive an instance for this class)

In the data type declaration for `Foo'

Change History

Changed 5 years ago by guest

  • cc tom.davie@… added

Changed 5 years ago by simonpj

  • difficulty set to Unknown

Thanks for the suggestion. Happily this is already done: see #2604.

Simon

Changed 5 years ago by simonpj

  • status changed from new to closed
  • resolution set to duplicate
Note: See TracTickets for help on using tickets.