summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-04-17 20:16:37 +0000
committerBen Gamari <ben@smart-cactus.org>2020-04-17 20:16:37 +0000
commit0040f7ccaeb8a0f6945662c805eaa6c4bcc2023c (patch)
treed628f91a9275c7337c2623e69c4fd9ebe9ea82bf
parenta93331768f9a8e67df77184ced0a89b7263132b2 (diff)
downloadhaskell-0040f7ccaeb8a0f6945662c805eaa6c4bcc2023c.tar.gz
Fix warnings
-rw-r--r--compiler/GHC/Core/Op/Simplify.hs8
1 files changed, 2 insertions, 6 deletions
diff --git a/compiler/GHC/Core/Op/Simplify.hs b/compiler/GHC/Core/Op/Simplify.hs
index a3d75297d2..06a60968be 100644
--- a/compiler/GHC/Core/Op/Simplify.hs
+++ b/compiler/GHC/Core/Op/Simplify.hs
@@ -51,7 +51,6 @@ import GHC.Core.FVs ( mkRuleInfo )
import GHC.Core.Rules ( lookupRule, getRules )
import GHC.Types.Basic ( TopLevelFlag(..), isNotTopLevel, isTopLevel,
RecFlag(..), Arity )
-import GHC.Types.Unique ( hasKey )
import PrelNames ( keepAliveIdKey )
import MonadUtils ( mapAccumLM, liftIO )
import GHC.Types.Var ( isTyCoVar )
@@ -1906,14 +1905,11 @@ rebuildCall env (ArgInfo { ai_fun = fun, ai_args = rev_args }) cont
, TyArg {as_arg_ty=arg_ty}
, TyArg {as_arg_ty=arg_rep}
] <- rev_args
+ -- Extract type of second component of (# State# RealWorld, a #)
+ , Just (_, [_, _, _, ty']) <- splitTyConApp_maybe (contResultType cont)
= do { (env', f_arg) <- simplLamBndr (zapSubstEnv env) f_arg
; f_body' <- simplExprC env' f_body cont
; let f' = Lam f_arg f_body'
- -- Extract type of second component of (# State# RealWorld, a #)
- ty' = case splitTyConApp_maybe (contResultType cont) of
- Just (tc, [_, _, _, ty]) -> ty
- Nothing -> panic "rebuildCall: Malformed (#,#) type"
-
; let call' = mkApps (Var fun)
[ mkTyArg arg_rep, mkTyArg arg_ty
, mkTyArg (getRuntimeRep ty'), mkTyArg ty'