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

GHC ghc-devs at haskell.org
Mon Jul 2 02:37:03 UTC 2018


#14318: TH shadowing bind statement triggers -Wunused-matches
-------------------------------------+-------------------------------------
        Reporter:  lyxia             |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Template Haskell  |              Version:  8.2.1
      Resolution:                    |             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:                    |
-------------------------------------+-------------------------------------
Changes (by mgsloan):

 * owner:  mgsloan => (none)


Comment:

 I've looked into this a bit.  It looks like names created by `newName` are
 turned into GHC names via `mkSystemNameAt`, and integer making the name
 unique is used directly.  See `Convert.thRdrName`.

 I'm guessing that code involving warnings is expecting that these unique
 names are unique per binding site, whereas in this case the same unique
 name is bound multiple times.

 I'm not sure what the correct approach is to fixing this.  It could either
 be to fix the warning code, or, alternatively, have TH ensure that
 generated code has per-binding uniqueness.

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


More information about the ghc-tickets mailing list