[GHC] #12399: DeriveFunctor fail

GHC ghc-devs at haskell.org
Mon Jul 18 14:11:57 UTC 2016


#12399: DeriveFunctor fail
-------------------------------------+-------------------------------------
        Reporter:  osa1              |                Owner:
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler (Type    |              Version:  8.1
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D2404
       Wiki Page:                    |
-------------------------------------+-------------------------------------

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

 In [changeset:"3fa3fe8a9a8afa67829e12efa5d25b76e58a185a/ghc" 3fa3fe8/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="3fa3fe8a9a8afa67829e12efa5d25b76e58a185a"
 Make DeriveFunctor work with unboxed tuples

 Summary:
 Unboxed tuples have `RuntimeRep` arguments which `-XDeriveFunctor` was
 mistaking for actual data constructor arguments. As a result, a derived
 `Functor` instance for a datatype that contained an unboxed tuple would
 generate twice as many arguments as it needed for an unboxed tuple pattern
 match or expression. The solution is to simply put `dropRuntimeRepArgs` in
 the
 right place.

 Fixes #12399.

 Test Plan: ./validate

 Reviewers: austin, hvr, bgamari

 Reviewed By: bgamari

 Subscribers: thomie, osa1

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

 GHC Trac Issues: #12399
 }}}

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


More information about the ghc-tickets mailing list