• Ryan Scott's avatar
    Check for mismatched class methods during typechecking · 1879d9d2
    Ryan Scott authored
    Summary:
    Template Haskell provides a wormhole through which you can
    sneak methods that don't belong to a class into an instance for that
    class, bypassing the renamer's validity checks. The solution adopted
    here is to mirror the treatment for associated type family instances,
    which have an additional check in the typechecker which catch
    mismatched associated type families that were snuck through using
    Template Haskell. I've put a similar check for class methods into
    `tcMethods`.
    
    Test Plan: make test TEST=T12387
    
    Reviewers: bgamari, simonpj
    
    Reviewed By: bgamari, simonpj
    
    Subscribers: simonpj, rwbarton, thomie, carter
    
    GHC Trac Issues: #12387
    
    Differential Revision: https://phabricator.haskell.org/D4710
    1879d9d2
all.T 18.3 KB