id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
3221	"Incorrect ""defined but not used"" warning for data types using deriving"	NeilMitchell		"Consider:

{{{

module Main() where

import System

data Foo = Bar | Baz
           deriving (Show,Read)

main = do
    [x] <- getArgs
    print (read x :: Foo)
}}}

When we compile:

{{{
$ ghc -c Test.hs -fwarn-unused-binds
Test.hs:6:11: Warning: Defined but not used: data constructor `Bar'
Test.hs:6:17: Warning: Defined but not used: data constructor `Baz'
}}}

This is incorrect. If a data type derives {{{Read}}}, {{{Enum}}} or {{{Bounded}}} (and for {{{Bounded}}}, is either the first or last element), then the values are used - even if not by name."	bug	closed	normal	6.12 branch	Compiler	6.10.2	fixed		ndmitchell@…	Unknown/Multiple	Unknown/Multiple		Unknown	rename/should_compile/T3221			
