lintStgAlts :: [StgAlt]
            -> Type               -- Type of scrutinee
            -> LintM (Maybe Type) -- Just ty => type is accurage

lintStgAlts alts scrut_ty = do
    maybe_result_tys <- mapM (lintAlt scrut_ty) alts

    -- Check the result types
    case catMaybes (maybe_result_tys) of
      []             -> return Nothing

      (first_ty:_tys) -> do -- mapM_ check tys
                           return (Just first_ty)
        where
          -- check ty = checkTys first_ty ty (mkCaseAltMsg alts)
          -- We can't check that the alternatives have the
          -- same type, because they don't, with unsafeCoerce#
lintStgAlts :: [StgAlt]
            -> Type               -- Type of scrutinee
            -> LintM (Maybe Type)
lintStgAlts alts scrut_ty = do
    maybe_result_tys <- mapM (lintAlt scrut_ty) alts

    -- Check the result types
    case catMaybes (maybe_result_tys) of
      []             -> return Nothing

      (first_ty:_tys) -> do -- mapM_ check tys
                           return (Just first_ty)
        where
          -- check ty = checkTys first_ty ty (mkCaseAltMsg alts)
          -- We can't check that the alternatives have the
          -- same type, because they don't, with unsafeCoerce#
lintStgAlts alts scrut_ty = do
    maybe_result_tys <- mapM (lintAlt scrut_ty) alts

    -- Check the result types
    case catMaybes (maybe_result_tys) of
      []             -> return Nothing

      (first_ty:_tys) -> do -- mapM_ check tys
                           return (Just first_ty)
        where
          -- check ty = checkTys first_ty ty (mkCaseAltMsg alts)
          -- We can't check that the alternatives have the
          -- same type, because they don't, with unsafeCoerce#