[GHC] #15520: Invalid warning Defined but not used

GHC ghc-devs at haskell.org
Thu Aug 16 11:28:21 UTC 2018


#15520: Invalid warning Defined but not used
-------------------------------------+-------------------------------------
        Reporter:  rik               |                Owner:  (none)
            Type:  bug               |               Status:  infoneeded
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by rik):

 {{{
 However, this is correct behavior, since x is not used anywhere (and
 therefore :+++ is transitively not used)
 }}}

 Okay, I see now, I'm confused.

 `x` is exported so GHC does not know if it is used outside this module, so
 why this warning?

 See also
 https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/using-
 warnings.html?highlight=unused-top-binds#ghc-flag--Wunused-top-binds


 {{{
 A variable is regarded as “used” if

 It is exported, or
 It appears in the right hand side of a binding that binds at least one
 used variable that is used

 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15520#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list