[GHC] #3873: template haskell: incorrect Warning: defined but not used

GHC trac at galois.com
Wed Feb 10 16:57:31 EST 2010


#3873: template haskell: incorrect Warning: defined but not used
---------------------------------+------------------------------------------
    Reporter:  JakeWheat         |       Owner:                                   
        Type:  bug               |      Status:  new                              
    Priority:  normal            |   Component:  Compiler                         
     Version:  6.12.1            |    Keywords:                                   
          Os:  Unknown/Multiple  |    Testcase:                                   
Architecture:  Unknown/Multiple  |     Failure:  Incorrect warning at compile-time
---------------------------------+------------------------------------------
 example code:
 {{{
 {-# LANGUAGE TemplateHaskell #-}

 module THWarnBug where

 import Language.Haskell.TH

 mhlt :: Q Type
 mhlt = do
   let u = [t| String |]
   [t| $u |]

 }}}

 compiling gives:

 {{{
 $ ghc -c -Wall THWarnBug.hs

 THWarnBug.hs:9:6: Warning: Defined but not used: `u'
 }}}

 but obviously u is used.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3873>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list