ASSERT( isId new_bndr )
WARN( new_arity < old_arity || new_arity < dmd_arity,
(ptext (sLit "Arity decrease:") <+> ppr final_id <+> ppr old_arity
- <+> ppr new_arity <+> ppr dmd_arity) $$ ppr new_rhs )
+ <+> ppr new_arity <+> ppr dmd_arity) )
-- Note [Arity decrease]
final_id `seq` -- This seq forces the Id, and hence its IdInfo,
simplExprF' env (Type ty) cont
= ASSERT( contIsRhsOrArg cont )
- do { ty' <- simplType env ty
+ do { ty' <- simplCoercion env ty
; rebuild env (Type ty') cont }
simplExprF' env (Case scrut bndr _ alts) cont
---------------------------------
simplCoercion :: SimplEnv -> InType -> SimplM OutType
+-- The InType isn't *necessarily* a coercion, but it might be
+-- (in a type application, say) and optCoercion is a no-op on types
simplCoercion env co
= do { co' <- simplType env co
; return (optCoercion co') }
| otherwise = mkCoerce co expr
rebuildCall env fun info (ApplyTo _ (Type arg_ty) se cont)
- = do { ty' <- simplType (se `setInScope` env) arg_ty
+ = do { ty' <- simplCoercion (se `setInScope` env) arg_ty
; rebuildCall env (fun `App` Type ty') info cont }
rebuildCall env fun