summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2007-09-06 09:03:46 +0000
committersimonpj@microsoft.com <unknown>2007-09-06 09:03:46 +0000
commit08ea4e6d331cb4bf1b5ea6ddcc688890a17d9097 (patch)
tree7690756103e6b7331c4b6ac66955b07208df2be1
parent8b7eaa404043294bd4cb4a0322ac1f7115bad6a0 (diff)
downloadhaskell-08ea4e6d331cb4bf1b5ea6ddcc688890a17d9097.tar.gz
Fix zonking in mkExports
I'd missed zonk, so that an error message for missing type signature read (unhelpfully) main/GHC.hs:1070:0: Warning: Definition but no type signature for `upsweep'' Inferred type: upsweep' :: forall t1. t The trouble was that 't' hadn't been zonked. Push to the stable branch
-rw-r--r--compiler/typecheck/TcBinds.lhs11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/typecheck/TcBinds.lhs b/compiler/typecheck/TcBinds.lhs
index 671bfeac4c..ba4bfc61ad 100644
--- a/compiler/typecheck/TcBinds.lhs
+++ b/compiler/typecheck/TcBinds.lhs
@@ -378,17 +378,18 @@ mkExport top_lvl prag_fn inferred_tvs dict_tys (poly_name, mb_sig, mono_id)
= do { warn_missing_sigs <- doptM Opt_WarnMissingSigs
; let warn = isTopLevel top_lvl && warn_missing_sigs
; (tvs, poly_id) <- mk_poly_id warn mb_sig
+ -- poly_id has a zonked type
- ; poly_id' <- zonkId poly_id
- ; prags <- tcPrags poly_id' (prag_fn poly_name)
+ ; prags <- tcPrags poly_id (prag_fn poly_name)
-- tcPrags requires a zonked poly_id
- ; return (tvs, poly_id', mono_id, prags) }
+ ; return (tvs, poly_id, mono_id, prags) }
where
poly_ty = mkForAllTys inferred_tvs (mkFunTys dict_tys (idType mono_id))
- mk_poly_id warn Nothing = do { missingSigWarn warn poly_name poly_ty
- ; return (inferred_tvs, mkLocalId poly_name poly_ty) }
+ mk_poly_id warn Nothing = do { poly_ty' <- zonkTcType poly_ty
+ ; missingSigWarn warn poly_name poly_ty'
+ ; return (inferred_tvs, mkLocalId poly_name poly_ty') }
mk_poly_id warn (Just sig) = do { tvs <- mapM zonk_tv (sig_tvs sig)
; return (tvs, sig_id sig) }