Commit c3c5bee6 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com
Browse files

Add absentError.

This patch accompanies the HEAD patch:

  Tue Sep 14 12:38:27 BST 2010  simonpj@microsoft.com
    * Make absent-arg wrappers work for unlifted types (fix Trac #4306)
    
    Previously we were simply passing arguments of unlifted
    type to a wrapper, even if they were absent, which was
    stupid.
    
    See Note [Absent error Id] in WwLib.
parent b6c6bc87
...@@ -109,6 +109,7 @@ module Control.Exception.Base ( ...@@ -109,6 +109,7 @@ module Control.Exception.Base (
-- * Calls for GHC runtime -- * Calls for GHC runtime
recSelError, recConError, irrefutPatError, runtimeError, recSelError, recConError, irrefutPatError, runtimeError,
nonExhaustiveGuardsError, patError, noMethodBindingError, nonExhaustiveGuardsError, patError, noMethodBindingError,
absentError,
nonTermination, nestedAtomically, nonTermination, nestedAtomically,
#endif #endif
) where ) where
...@@ -705,12 +706,14 @@ instance Exception NestedAtomically ...@@ -705,12 +706,14 @@ instance Exception NestedAtomically
#ifdef __GLASGOW_HASKELL__ #ifdef __GLASGOW_HASKELL__
recSelError, recConError, irrefutPatError, runtimeError, recSelError, recConError, irrefutPatError, runtimeError,
nonExhaustiveGuardsError, patError, noMethodBindingError nonExhaustiveGuardsError, patError, noMethodBindingError,
absentError
:: Addr# -> a -- All take a UTF8-encoded C string :: Addr# -> a -- All take a UTF8-encoded C string
recSelError s = throw (RecSelError ("No match in record selector " recSelError s = throw (RecSelError ("No match in record selector "
++ unpackCStringUtf8# s)) -- No location info unfortunately ++ unpackCStringUtf8# s)) -- No location info unfortunately
runtimeError s = error (unpackCStringUtf8# s) -- No location info unfortunately runtimeError s = error (unpackCStringUtf8# s) -- No location info unfortunately
absentError s = error ("Oops! Entered absent arg " ++ unpackCStringUtf8# s)
nonExhaustiveGuardsError s = throw (PatternMatchFail (untangle s "Non-exhaustive guards in")) nonExhaustiveGuardsError s = throw (PatternMatchFail (untangle s "Non-exhaustive guards in"))
irrefutPatError s = throw (PatternMatchFail (untangle s "Irrefutable pattern failed for pattern")) irrefutPatError s = throw (PatternMatchFail (untangle s "Irrefutable pattern failed for pattern"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment