[GHC] #14318: TH shadowing bind statement triggers -Wunused-matches

GHC ghc-devs at haskell.org
Wed Oct 4 16:23:00 UTC 2017


#14318: TH shadowing bind statement triggers -Wunused-matches
-------------------------------------+-------------------------------------
           Reporter:  lyxia          |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Template       |           Version:  8.2.1
  Haskell                            |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Incorrect
  Unknown/Multiple                   |  error/warning at compile-time
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 {{{
 $(newName "x" >>= \x ->
   newName "f" >>= \f ->
   lamE [varP f, varP x]
     (doE [ bindS (varP x) (listE [varE f `appE` varE x])
          , noBindS (varE x)])
  )
 }}}

 generates the following expression:

 {{{
 \f x -> do
   x <- f x
   x
 }}}

 and `-Wunused-matches` complains that `x` is not used, while both bound
 occurrences are in fact used.

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


More information about the ghc-tickets mailing list