Actually make the scrutinee binder removal not crash.
authorMatthijs Kooijman <matthijs@stdin.nl>
Wed, 11 Nov 2009 13:38:26 +0000 (14:38 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Wed, 11 Nov 2009 13:38:26 +0000 (14:38 +0100)
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)
 
 --------------------------------