[GHC] #15471: Polymorphism, typed splices and type inference don't mix

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


#15471: Polymorphism, typed splices and type inference don't mix
-------------------------------------+-------------------------------------
        Reporter:  mpickering        |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Template Haskell  |              Version:  8.4.3
      Resolution:  fixed             |             Keywords:
                                     |  TypedTemplateHaskell
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:  th/T15471
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D5286,
       Wiki Page:                    |  https://gitlab.haskell.org/ghc/ghc/merge_requests/106
-------------------------------------+-------------------------------------

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/15471#comment:21>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list