#1954: Incorrect "Defined but not used" warning when using
GeneralizedNewtypeDeriving
-------------------------+--------------------------------------------------
    Reporter:  magnus    |       Owner:         
        Type:  bug       |      Status:  new    
    Priority:  normal    |   Milestone:         
   Component:  Compiler  |     Version:  6.8.1  
    Severity:  normal    |    Keywords:         
  Difficulty:  Unknown   |    Testcase:         
Architecture:  Unknown   |          Os:  Unknown
-------------------------+--------------------------------------------------
 When compiling
 {{{
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
 {-# OPTIONS_GHC -Wall -Werror #-}
 module Bug(P, runP) where

 import Control.Monad.Identity(Identity, runIdentity)

 newtype P a = P { unP :: Identity a } deriving Monad

 runP :: P a -> a
 runP = runIdentity . unP
 }}}
 I get
 {{{
 Bug.hs:7:14: Warning: Defined but not used: data constructor `P'
 }}}
 although the constructor is used in the derived Monad instance.  This is
 obviously not a show stopper, but it forces me to rewrite what to me looks
 like an OK program if I want to stick to the given OPTIONS_GHC.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1954>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to