[GHC] #15863: Splcing a type class method selects the wrong instance

GHC ghc-devs at haskell.org
Mon Mar 4 18:51:01 UTC 2019


#15863: Splcing a type class method selects the wrong instance
-------------------------------------+-------------------------------------
        Reporter:  mpickering        |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Template Haskell  |              Version:  8.6.1
      Resolution:                    |             Keywords:
                                     |  TypedTemplateHaskell
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Marge Bot <ben+marge-bot@…>):

 In [changeset:"a48753bdbc99cda36890e851950f5b79e1c3b2b2/ghc" a48753b/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="a48753bdbc99cda36890e851950f5b79e1c3b2b2"
 Capture and simplify constraints arising from running typed splices

 This fixes a regression caused by #15471 where splicing in a trivial
 program such as `[|| return () ||]` would fail as the dictionary for
 `return` would never get bound in the module containing the splice.

 Arguably this is symptomatic of a major problem affecting TTH where we
 serialise renamed asts and then retype check them. The reference to the
 dictionary should be fully determined at the quote site so that splicing
 doesn't have to solve any implicits at all. It's a coincidence this
 works due to coherence but see #15863 and #15865 for examples where
 things do go very wrong.

 Fixes #16195
 }}}

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


More information about the ghc-tickets mailing list