diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2017-02-17 12:47:39 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2017-02-17 14:00:30 +0000 |
commit | e55986a9810129d47a59c0bd4fcdc96f32108041 (patch) | |
tree | 885fe5cfe6b30156f760bb4a12e14844f7cc8b4a | |
parent | 8d401e50ce35525dcdc6a21fcf952c3cbf3a72d4 (diff) | |
download | haskell-e55986a9810129d47a59c0bd4fcdc96f32108041.tar.gz |
Fix a substitution bug in cseCase
There was a missing substTy in cseCase! Wow. I'm surprised
it has not caused problems. Anyway, easily fixed.
-rw-r--r-- | compiler/simplCore/CSE.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/simplCore/CSE.hs b/compiler/simplCore/CSE.hs index 21dbd0790a..80013a3f89 100644 --- a/compiler/simplCore/CSE.hs +++ b/compiler/simplCore/CSE.hs @@ -392,8 +392,9 @@ cseExpr env (Case e bndr ty alts) = cseCase env e bndr ty alts cseCase :: CSEnv -> InExpr -> InId -> InType -> [InAlt] -> OutExpr cseCase env scrut bndr ty alts - = Case scrut1 bndr3 ty (map cse_alt alts) + = Case scrut1 bndr3 ty' (map cse_alt alts) where + ty' = substTy (csEnvSubst env) ty scrut1 = tryForCSE False env scrut bndr1 = zapIdOccInfo bndr |