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

GHC ghc-devs at haskell.org
Mon Oct 5 04:42:50 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):
-------------------------------------+-------------------------------------

Comment (by gridaphobe):

 Hrm, unfortunately splitting off the wanted IP constraints in
 `simplifyInfer` doesn't work because we need them to infer a corresponding
 given. For example, in

 {{{#!haskell
 f :: (?x :: Int) => Int
 f = let y = ?x in y
 }}}

 we want to infer `y :: (?x :: Int) => Int` (according to the Note
 "Inheriting Implicit Parameters"). But with CallStack IPs,

 {{{#!haskell
 f :: (?x :: CallStack) => [(String, SrcLoc)]
 f = let y = getCallStack ?x in y
 }}}

 we want to infer `y :: [(String, SrcLoc)]`. We really '''don't''' want to
 infer a CallStack IP here because that would add an extra location to the
 stack.

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


More information about the ghc-tickets mailing list