[project @ 2002-02-15 09:32:18 by simonpj]
authorsimonpj <unknown>
Fri, 15 Feb 2002 09:32:18 +0000 (09:32 +0000)
committersimonpj <unknown>
Fri, 15 Feb 2002 09:32:18 +0000 (09:32 +0000)
commit87a229b84c8b4958d57cb37e92c27fe18f4bc28a
treec1a9a8c2dcf563cceb5c882e5a404c6e055ecef9
parent98694bb7b4504b0caac879131a6b1e09a433663f
[project @ 2002-02-15 09:32:18 by simonpj]
-------------------------------------------------
Fix an interesting case-alternatives filtering bug
-------------------------------------------------

This bug, shown up by Krasimir's ObjectIO suite, caused the
simplifier to encounter a case expression like
case x of { x:xs -> True; [] -> False }
in a context where x could not possibly be either a (:) or []!
Case expressions in the enclosing scope dealt with it...
So the alternative-filtering removed all the alternatives, leaving
a case expression with no branches, which GHC didn't like one little
bit.

The actual bug was elsewhere; it was because we should sometimes
filter out the DEFAULT alternative, and we weren't doing that.
To fix it, I pulled the alternative-filtering code out of Simplify
and put it in SimplUtils.prepareAlts.  It's nice now.
ghc/compiler/simplCore/SimplUtils.lhs
ghc/compiler/simplCore/Simplify.lhs