[GHC] #9049: Expose srcLoc from the assertion architecture to allow better error messages

GHC ghc-devs at haskell.org
Sun Dec 21 11:44:41 UTC 2014


#9049: Expose srcLoc from the assertion architecture to allow better error
messages
-------------------------------------+-------------------------------------
              Reporter:  nh2         |            Owner:  gridaphobe
                  Type:  feature     |           Status:  patch
  request                            |        Milestone:
              Priority:  normal      |          Version:  7.8.2
             Component:  Compiler    |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:  Phab:D578   |
-------------------------------------+-------------------------------------

Comment (by rodlogic):

 Replying to [comment:19 gridaphobe]:
 > I've sent a patch that implements
 [wiki:ExplicitCallStack/ImplicitLocations] to Phab
 (https://phabricator.haskell.org/D578).
 This is great. I would have taken me quite a while to get there.

 In your patch you mention that you didn't change base at this point, could
 we at least change GHC.Base to use it and add a new assertMsg?

 This would basically cover the ASSERT macros that exist in HsVersions.h:
 {{{
 #define ASSERT(e)      if debugIsOn && not (e) then (assertPanic __FILE__
 __LINE__) else
 #define ASSERT2(e,msg) if debugIsOn && not (e) then (assertPprPanic
 __FILE__ __LINE__ (msg)) else
 #define MASSERT(e)      ASSERT(e) return ()
 #define MASSERT2(e,msg) ASSERT2(e,msg) return ()
 #define ASSERTM(e)      do { bool <- e; MASSERT(bool) }
 #define ASSERTM2(e,msg) do { bool <- e; MASSERT2(bool,msg) }
 }}}

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


More information about the ghc-tickets mailing list