[GHC] #12399: DeriveFunctor fail

GHC ghc-devs at haskell.org
Thu Aug 25 15:04:17 UTC 2016


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

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

 In [changeset:"1f862acbd7d38b28a205002cded4f7b8824262e5/ghc"
 1f862acb/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="1f862acbd7d38b28a205002cded4f7b8824262e5"
 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

 (cherry picked from commit 3fa3fe8a9a8afa67829e12efa5d25b76e58a185a)
 }}}

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


More information about the ghc-tickets mailing list