Skip to content
  • Simon Peyton Jones's avatar
    Make CaseElim a bit less aggressive · 28d9a032
    Simon Peyton Jones authored
    See Note [Case elimination: lifted case]:
    
    We used to do case elimination if
            (c) the scrutinee is a variable and 'x' is used strictly
    But that changes
        case x of { _ -> error "bad" }
        --> error "bad"
    which is very puzzling if 'x' is later bound to (error "good").
    Where the order of evaluation is specified (via seq or case)
    we should respect it.
    
    c.f. Note [Empty case alternatives] in CoreSyn, which is how
    I came across this.
    28d9a032