{-# LANGUAGE GHCForeignImportPrim #-}
{-# LANGUAGE UnliftedFFITypes #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE EmptyCase #-}
module GHC.Prim.Panic
( absentSumFieldError
, panicError
)
where
import GHC.Prim
import GHC.Magic
default ()
foreign import prim "stg_paniczh" panic# :: Addr# -> State# RealWorld -> (# State# RealWorld, Void# #)
panicError :: Addr# -> a
panicError :: forall a. Addr# -> a
panicError Addr#
errmsg =
(State# RealWorld -> a) -> a
forall o. (State# RealWorld -> o) -> o
runRW# (\State# RealWorld
s ->
case Addr# -> State# RealWorld -> (# State# RealWorld, Void# #)
panic# Addr#
errmsg State# RealWorld
s of
(# State# RealWorld
_, Void#
_ #) ->
let x :: t
x = t
x in a
forall {t}. t
x)
absentSumFieldError :: a
absentSumFieldError :: forall {t}. t
absentSumFieldError = Addr# -> a
forall a. Addr# -> a
panicError Addr#
"entered absent sum field!"#
{-# NOINLINE absentSumFieldError #-}