summaryrefslogtreecommitdiff
path: root/compiler/iface
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-07-24 08:57:34 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2018-07-24 08:57:34 +0100
commite1b5a1174e42e390855b153015ce5227b3251d89 (patch)
treefde15f0774013eb06559da5a5173ec53b0b7803f /compiler/iface
parentf0d27f515ffbc476144d1d1dd1a71bf9fa93c94b (diff)
downloadhaskell-e1b5a1174e42e390855b153015ce5227b3251d89.tar.gz
Fix a nasty bug in piResultTys
I was failing to instantiate vigorously enough in Type.piResultTys and in the very similar function ToIface.toIfaceAppArgsX This caused Trac #15428. The fix is easy. See Note [Care with kind instantiation] in Type.hs
Diffstat (limited to 'compiler/iface')
-rw-r--r--compiler/iface/ToIface.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/iface/ToIface.hs b/compiler/iface/ToIface.hs
index c6284d1421..08ddf82e69 100644
--- a/compiler/iface/ToIface.hs
+++ b/compiler/iface/ToIface.hs
@@ -305,10 +305,10 @@ toIfaceAppArgsX fr kind ty_args
go env (FunTy _ res) (t:ts) -- No type-class args in tycon apps
= IA_Vis (toIfaceTypeX fr t) (go env res ts)
- go env (TyVarTy tv) ts
- | Just ki <- lookupTyVar env tv = go env ki ts
- go env kind (t:ts) = WARN( True, ppr kind $$ ppr ty_args )
- IA_Vis (toIfaceTypeX fr t) (go env kind ts) -- Ill-kinded
+ go env ty ts = ASSERT2( not (isEmptyTCvSubst env)
+ , ppr kind $$ ppr ty_args )
+ go (zapTCvSubst env) (substTy env ty) ts
+ -- See Note [Care with kind instantiation] in Type.hs
tidyToIfaceType :: TidyEnv -> Type -> IfaceType
tidyToIfaceType env ty = toIfaceType (tidyType env ty)