Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#4486 closed bug (worksforme)

Unable to satisfy "Defined but not used: data constructor" warning

Reported by: mitar Owned by:
Priority: normal Milestone: 7.4.1
Component: Compiler Version: 6.12.3
Keywords: Cc: mmitar@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I am unable to satisfy "Defined but not used: data constructor" warning. I have defined a data type like:

data FooBar = FooBar {}

And if I export FooBar then I get Defined but not used: data constructor warning. If I export FooBar(..) then I get The export item suggests that has (in-scope) constructors or class methods, but it has none. How can I export such data type without a warning?

Change History (3)

comment:1 Changed 9 years ago by igloo

Milestone: 7.2.1

Sounds like a bug. Thanks for the report.

comment:2 Changed 9 years ago by simonpj

Resolution: worksforme
Status: newclosed

I can't reproduce this. Here's the module I'm compiling:

module T4486( FooBar(..) ) where
data FooBar = FooBar {}

Here we go:

bash-3.1$ ghc -c T4486.hs -Wall -fforce-recomp
bash-3.1$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.3

If you get different results, please re-open and show the results you get.


comment:3 Changed 9 years ago by mitar

I also cannot reproduce it anymore. It seems to work correctly on a 7.1 version.

Note: See TracTickets for help on using tickets.