[GHC] #12387: Template Haskell ignores class instance definitions with methods that don't belong to the class

GHC ghc-devs at haskell.org
Thu May 24 15:19:31 UTC 2018


#12387: Template Haskell ignores class instance definitions with methods that don't
belong to the class
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Template Haskell  |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC accepts       |  Unknown/Multiple
  invalid program                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D4710
       Wiki Page:                    |
-------------------------------------+-------------------------------------

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

 In [changeset:"1879d9d2c95239f6705af0cbac5fed7d9b220f28/ghc" 1879d9d/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="1879d9d2c95239f6705af0cbac5fed7d9b220f28"
 Check for mismatched class methods during typechecking

 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
 }}}

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


More information about the ghc-tickets mailing list