-tagToEnumRule _ [Type ty, _]
- | not (is_enum_ty ty) -- See Note [tagToEnum#]
- = WARN( True, ptext (sLit "tagToEnum# on non-enumeration type") <+> ppr ty )
- Just (mkRuntimeErrorApp rUNTIME_ERROR_ID ty "tagToEnum# on non-enumeration type")
- where
- is_enum_ty ty = case splitTyConApp_maybe ty of
- Just (tc, _) -> isEnumerationTyCon tc
- Nothing -> False
-