From 4c6ea37bfa58008a0479625f97859c959eee4cf0 Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 18 Oct 2001 08:22:06 +0000 Subject: [PATCH] [project @ 2001-10-18 08:22:06 by simonpj] Wibble to case fiddling; dont merge --- ghc/compiler/simplCore/Simplify.lhs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ghc/compiler/simplCore/Simplify.lhs b/ghc/compiler/simplCore/Simplify.lhs index ee35251..d32dd41 100644 --- a/ghc/compiler/simplCore/Simplify.lhs +++ b/ghc/compiler/simplCore/Simplify.lhs @@ -1239,9 +1239,11 @@ rebuildCase env scrut case_bndr alts cont other -> [alt | alt@(con,_,_) <- alts, not (con `elem` impossible_cons)] - -- handled_cons are handled either by the context, - -- or by an alternative in this case - handled_cons = impossible_cons ++ [con | (con,_,_) <- better_alts] + -- "handled_cons" are handled either by the context, + -- or by a branch in this case expression + -- Don't add DEFAULT to the handled_cons!! + (alts_wo_default, _) = findDefault better_alts + handled_cons = impossible_cons ++ [con | (con,_,_) <- alts_wo_default] in -- Deal with the case binder, and prepare the continuation; -- 1.7.10.4