[GHC] #15637: Ambiguous type variables in GeneralisedNewtypeDeriving

GHC ghc-devs at haskell.org
Mon Oct 1 16:48:47 UTC 2018


#15637: Ambiguous type variables in GeneralisedNewtypeDeriving
-------------------------------------+-------------------------------------
        Reporter:  i-am-tom          |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:                    |             Keywords:  deriving
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D5148
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ryan Scott <ryan.gl.scott@…>):

 In [changeset:"309438e948359a0ae71ffac4a41ebcd855cf5657/ghc"
 309438e9/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="309438e948359a0ae71ffac4a41ebcd855cf5657"
 Fix #15637 by using VTA more in GND

 Summary:
 The code that GND was generating before could crumple over
 if it derived an instance for a class with an ambiguous type variable
 in the class head, such as the example in #15637. The solution is
 straightforward: simply instantiate all variables bound by the class
 head explicitly using visible type application, which will nip any
 ambiguity in the bud.

 Test Plan: make test TEST=T15637

 Reviewers: bgamari, simonpj, goldfire

 Reviewed By: simonpj

 Subscribers: simonpj, rwbarton, carter

 GHC Trac Issues: #15637

 Differential Revision: https://phabricator.haskell.org/D5148
 }}}

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


More information about the ghc-tickets mailing list