[GHC] #10845: Incorrect behavior when let binding implicit CallStack object

GHC ghc-devs at haskell.org
Tue Nov 3 17:46:02 UTC 2015


#10845: Incorrect behavior when let binding implicit CallStack object
-------------------------------------+-------------------------------------
        Reporter:  nitromaster101    |                Owner:  gridaphobe
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.11
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #10846            |  Differential Rev(s):  Phab:D1422
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by gridaphobe):

 If I understand your suggestion correctly, this won't fix my example. Why?
 Because `?loc` creates an `IPOccOrigin` constraint, which you suggest we
 should freely solve from other call-stack constraints (I take this to mean
 the usual form of solving an IP, ie we don't push on the stack). So the
 two `?loc` constraints would be consolidated to one, which we would
 default to the empty stack.

 But perhaps this isn't so bad after all. My example was a bit of a red
 herring, what we really care about is that in

 {{{
 f :: (?stk :: CallStack) => ..

 main = print (f 0) >> print (f 1)
 }}}

 the two calls to `f` are not consolidated to a single constraint. `f x`
 gives rise to an `OccurrenceOf` constraint, which you suggest we would
 solve by pushing on the stack and emitting an `IPOccOrigin` constraint, so
 we '''would''' get the correct behavior here.

 So, I think under your suggestion, we'll never see a `?loc` in the call-
 stack, but I think that's fine. (It always stuck me as a bit odd to have
 the root of the call-stack be an occurrence of an IP, rather than a
 function call)

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


More information about the ghc-tickets mailing list