• Ömer Sinan Ağacan's avatar
    reify associated types when reifying typeclasses(#10891) · b4d43b4e
    Ömer Sinan Ağacan authored
    As reported in Trac #10891, Template Haskell's `reify` was not
    generating Decls for associated types. This patch fixes that.
    
    Note that even though `reifyTyCon` function used in this patch returns
    some type instances, I'm ignoring that.
    
    Here's an example of how associated types are encoded with this patch:
    
    (Simplified representation)
    
        class C a where
          type F a :: *
    
        -->
    
        OpenTypeFamilyD "F" ["a"]
    
    With default type instances:
    
        class C a where
          type F a :: *
          type F a = a
    
        -->
    
        OpenTypeFamilyD "F" ["a"]
        TySynInstD "F" (TySynEqn [VarT "a"] "a")
    
    Test Plan:
    This patch was already reviewed and even merged. The patch is later
    reverted because apparently it broke the build some time between the
    validation of this patch and merge. Creating this new ticket to fix the
    validation.
    
    Reviewers: goldfire, austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1277
    
    GHC Trac Issues: #10891
    b4d43b4e
all.T 14 KB