2 % (c) The GRASP Project, Glasgow University, 1992-1998
4 \section{Panic error messages}
6 Defines basic funtions for printing error messages.
8 It's hard to put these functions anywhere else without causing
9 some unnecessary loops in the module dependency graph.
12 module Panic ( panic, panic#, assertPanic, trace ) where
14 import IOExts ( trace )
17 #include "HsVersions.h"
22 panic x = error ("panic! (the `impossible' happened):\n\t"
24 ++ "Please report it as a compiler bug "
25 ++ "to glasgow-haskell-bugs@haskell.org.\n\n" )
27 -- #-versions because panic can't return an unboxed int, and that's
28 -- what TAG_ is with GHC at the moment. Ugh. (Simon)
29 -- No, man -- Too Beautiful! (Will)
31 panic# :: String -> FastInt
32 panic# s = case (panic s) of () -> _ILIT 0
34 assertPanic :: String -> Int -> a
35 assertPanic file line = panic ("ASSERT failed! file " ++ file ++ ", line " ++ show line)