• Ryan Scott's avatar
    Make DeriveFunctor work with unboxed tuples · 3fa3fe8a
    Ryan Scott authored
    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
    3fa3fe8a
TcGenDeriv.hs 117 KB