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 )
16 #include "HsVersions.h"
21 panic x = error ("panic! (the `impossible' happened):\n\t"
23 ++ "Please report it as a compiler bug "
24 ++ "to glasgow-haskell-bugs@haskell.org.\n\n" )
26 -- #-versions because panic can't return an unboxed int, and that's
27 -- what TAG_ is with GHC at the moment. Ugh. (Simon)
28 -- No, man -- Too Beautiful! (Will)
30 panic# :: String -> FAST_INT
31 panic# s = case (panic s) of () -> ILIT(0)
33 assertPanic :: String -> Int -> a
34 assertPanic file line = panic ("ASSERT failed! file " ++ file ++ ", line " ++ show line)