Actually make the scrutinee binder removal not crash.
[matthijs/master-project/cλash.git] / cλash / CLasH / Normalize.hs
index 4f02800547b729e7cc405c5d4990c366c284b4cb..2c7a95e16b99b25987f13d8de875f498ae780ef0 100644 (file)
@@ -419,6 +419,8 @@ scrutbndrremove (Case (Var scrut) bndr ty alts) | bndr_used = do
       expr' <- substitute bndr (Var scrut) expr
       return (con, bndrs, expr')
     wild = MkCore.mkWildBinder (Id.idType bndr)
+-- Leave all other expressions unchanged
+scrutbndrremove expr = return expr
 scrutbndrremovetop = everywhere ("scrutbndrremove", scrutbndrremove)
 
 --------------------------------