{-
************************************************************************
*                                                                      *
                     Error Ids
*                                                                      *
************************************************************************

GHC randomly injects these into the code.

@patError@ is just a version of @error@ for pattern-matching
failures.  It knows various ``codes'' which expand to longer
strings---this saves space!

@absentErr@ is a thing we put in for ``absent'' arguments.  They jolly
well shouldn't be yanked on, but if one is, then you will get a
friendly message from @absentErr@ (rather than a totally random
crash).

@parError@ is a special version of @error@ which the compiler does
not know to be a bottoming Id.  It is used in the @_par_@ and @_seq_@
templates, but we don't ever expect to generate code for it.
-}

errorIds :: [Id]
errorIds
  = [ eRROR_ID,   -- This one isn't used anywhere else in the compiler
                  -- But we still need it in wiredInIds so that when GHC
                  -- compiles a program that mentions 'error' we don't
                  -- import its type from the interface file; we just get
                  -- the Id defined here.  Which has an 'open-tyvar' type.

      uNDEFINED_ID,   -- Ditto for 'undefined'. The big deal is to give it
                      -- an 'open-tyvar' type.

      rUNTIME_ERROR_ID,
      iRREFUT_PAT_ERROR_ID,
      nON_EXHAUSTIVE_GUARDS_ERROR_ID,
      nO_METHOD_BINDING_ERROR_ID,
      pAT_ERROR_ID,
      rEC_CON_ERROR_ID,
      rEC_SEL_ERROR_ID,
      aBSENT_ERROR_ID ]
errorIds :: [Id]
errorIds
  = [ eRROR_ID,   -- This one isn't used anywhere else in the compiler
                  -- But we still need it in wiredInIds so that when GHC
                  -- compiles a program that mentions 'error' we don't
                  -- import its type from the interface file; we just get
                  -- the Id defined here.  Which has an 'open-tyvar' type.

      uNDEFINED_ID,   -- Ditto for 'undefined'. The big deal is to give it
                      -- an 'open-tyvar' type.

      rUNTIME_ERROR_ID,
      iRREFUT_PAT_ERROR_ID,
      nON_EXHAUSTIVE_GUARDS_ERROR_ID,
      nO_METHOD_BINDING_ERROR_ID,
      pAT_ERROR_ID,
      rEC_CON_ERROR_ID,
      rEC_SEL_ERROR_ID,
      aBSENT_ERROR_ID ]
errorIds
  = [ eRROR_ID,   -- This one isn't used anywhere else in the compiler
                  -- But we still need it in wiredInIds so that when GHC
                  -- compiles a program that mentions 'error' we don't
                  -- import its type from the interface file; we just get
                  -- the Id defined here.  Which has an 'open-tyvar' type.

      uNDEFINED_ID,   -- Ditto for 'undefined'. The big deal is to give it
                      -- an 'open-tyvar' type.

      rUNTIME_ERROR_ID,
      iRREFUT_PAT_ERROR_ID,
      nON_EXHAUSTIVE_GUARDS_ERROR_ID,
      nO_METHOD_BINDING_ERROR_ID,
      pAT_ERROR_ID,
      rEC_CON_ERROR_ID,
      rEC_SEL_ERROR_ID,
      aBSENT_ERROR_ID ]