[GHC] #11098: PartialTypeSignatures mishandles type variables that begin with an underscore

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


#11098: PartialTypeSignatures mishandles type variables that begin with an
underscore
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                Owner:  msosn
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.0.1
       Component:  Template Haskell  |              Version:  7.10.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:  T11098,
                                     |  NamedWildcardsAsTyVars,
                                     |  NamedWildcardExplicitForall
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  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/11098#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list