[GHC] #10982: Warn about unused pattern variables in type families

GHC ghc-devs at haskell.org
Mon Dec 21 11:59:31 UTC 2015


#10982: Warn about unused pattern variables in type families
-------------------------------------+-------------------------------------
        Reporter:  jstolarek         |                Owner:  msosn
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.11
      Resolution:                    |             Keywords:  newcomer
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
                                     |  UnusedTyVarWarnings,
                                     |  UnusedTyVarWarningsNamedWCs
      Blocked By:                    |             Blocking:
 Related Tickets:  #11098            |  Differential Rev(s):  Phab:D1576
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"eb7796f13e701cce4e7d1d86f36c966aa17f1e9c/ghc" eb7796f/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="eb7796f13e701cce4e7d1d86f36c966aa17f1e9c"
 Warn about unused type variables in type families

 The warnings are enabled with the flag -fwarn-unused-matches, the same
 one that enables warnings on the term level.

 Identifiers starting with an underscore are now always parsed as type
 variables.  When the NamedWildCards extension is enabled, the renamer
 replaces those variables with named wildcards.

 An additional NameSet nwcs is added to LocalRdrEnv. It's used to keep
 names of the type variables that should be replaced with wildcards.

 While renaming HsForAllTy, when a name is explicitly bound it is removed
 from the nwcs NameSet. As a result, the renamer doesn't replace them in
 the quantifier body. (Trac #11098)

 Fixes #10982, #11098

 Reviewers: alanz, bgamari, hvr, austin, jstolarek

 Reviewed By: jstolarek

 Subscribers: goldfire, mpickering, RyanGlScott, thomie

 Differential Revision: https://phabricator.haskell.org/D1576

 GHC Trac Issues: #10982
 }}}

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


More information about the ghc-tickets mailing list