[GHC] #11573: Inferred CallStacks expose implicit parameter (was: CallStacks show up unexpectedly in type of local binding in GHCi)

GHC ghc-devs at haskell.org
Sat Feb 13 16:53:59 UTC 2016


#11573: Inferred CallStacks expose implicit parameter
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  gridaphobe
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.0.1
       Component:  Compiler (Type    |              Version:  8.0.1-rc2
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by gridaphobe):

 * owner:   => gridaphobe
 * priority:  high => normal


Comment:

 Just copying my response from ghc-devs :)

 ----

 The inferred CallStack is not a bug, it was added to fix #10845. The
 problem is that in a function like

 foo :: HasCallStack => ...
 foo x = let bar y = undefined
         in bar x

 we need to infer a CallStack for bar (due to the structure of the
 constraint solver) in order to link foo's CallStack to undefined.

 What '''is''' a bug is that GHC shows the implicit parameter in the
 inferred signature. We don't expose those anymore in the CallStack API,
 instead we use a type synonym HasCallStack. GHC should infer HasCallStack
 constraints instead.

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


More information about the ghc-tickets mailing list