[GHC] #14635: Double stacktrace with errorWithCallStack

GHC ghc-devs at haskell.org
Thu Jan 4 11:09:29 UTC 2018


#14635: Double stacktrace with errorWithCallStack
-------------------------------------+-------------------------------------
           Reporter:  flip101        |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Documentation  |           Version:  8.2.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Hello,

 The documentation of
 https://hackage.haskell.org/package/base-4.10.0.0/docs/GHC-
 Stack.html#t:CallStack uses the following code:

 {{{#!hs
 errorWithCallStack :: HasCallStack => String -> a
 errorWithCallStack msg = error (msg ++ "n" ++ prettyCallStack callStack)
 }}}

 But this is confusing because now you will get two stacktraces. One from
 error and one inside error with prettyCallStack.

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


More information about the ghc-tickets mailing list