Skip to content
  • Ben Gamari's avatar
    codeGen: Don't discard live case binders in unsafeEqualityProof logic · 9a7462fb
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    Previously CoreToStg would unconditionally discard cases of the form:
    
        case unsafeEqualityProof of wild { _ -> rhs }
    
    and rather replace the whole thing with `rhs`. However, in some cases
    (see #18227) the case binder is still live, resulting in unbound
    occurrences in `rhs`. Fix this by only discarding the case if the case
    binder is dead.
    
    Fixes #18227.
    9a7462fb