Skip to content
  • Simon Peyton Jones's avatar
    [project @ 2002-02-15 09:32:18 by simonpj] · 87a229b8
    Simon Peyton Jones authored
    -------------------------------------------------
    	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.
    87a229b8