#3449: Unavoidable "unused bindings" warnings in boot files
-----------------------------+----------------------------------------------
Reporter:  heatsink          |          Owner:                  
    Type:  bug               |         Status:  new             
Priority:  normal            |      Component:  Compiler        
 Version:  6.10.4            |       Severity:  minor           
Keywords:                    |       Testcase:                  
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
-----------------------------+----------------------------------------------
 The {{{-fwarn-unused-binds}}} flag produces warnings for bindings that
 cannot, in fact, be deleted from hs-boot files.  It would be nice not to
 see these warnings.  Definitions in .hs-boot files must match the
 definitions in .hs files, but .hs-boot files don't necessarily use or
 export the same identifiers that the .hs file does.

 Running {{{ghc -c A.hs-boot -fwarn-unused-binds}}} produces warnings for
 this hs-boot file, regardless of whether the identifiers are exported in
 the hs file.
 {{{
 {- A.hs-boot -}
 {-# OPTIONS_GHC -XTypeFamilies #-} -- to demonstrate associated type
 warnings
 module A(Foo, HasFoo) where

 newtype Foo = Foo {unFoo :: Int}
 class HasFoo a where
   data Foo' a
   getFoo :: a -> Foo
 }}}

 For identifiers defined on the RHS of an equal sign or 'where'---namely,
 data constructors, field names, class methods, and associated types---I
 suggest silencing unused binding warnings in the boot file.  The rationale
 is that you should be allowed to copy an entire definition into the boot
 file, and regard a binding as unused only if it appears unused in the .hs
 file.

 See also #3283.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3449>
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