diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-08-05 16:46:16 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-08-05 16:50:43 +0100 |
commit | 28096b274a3803b8a479c5dd94ebda655a15566c (patch) | |
tree | 5440c93d52d056d69df46453980b58047e5e29d9 /compiler/typecheck/TcBinds.hs | |
parent | 953648127cea2836ec134b03a966695ac0b36434 (diff) | |
download | haskell-28096b274a3803b8a479c5dd94ebda655a15566c.tar.gz |
Fix quantification for inference with sigs
When we are *inferring* the type of a let-bound function,
we might still have a type signature. And we must be sure
to quantify over its type variables, else you get the crash
in Trac #10615.
See Note [Which type variables to quantify] in TcSimplify
Diffstat (limited to 'compiler/typecheck/TcBinds.hs')
-rw-r--r-- | compiler/typecheck/TcBinds.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs index 9a7ad6184a..8a7ca4d5c1 100644 --- a/compiler/typecheck/TcBinds.hs +++ b/compiler/typecheck/TcBinds.hs @@ -650,9 +650,11 @@ tcPolyInfer rec_tc prag_fn tc_sig_fn mono bind_list tcMonoBinds rec_tc tc_sig_fn LetLclBndr bind_list ; let name_taus = [(name, idType mono_id) | (name, _, mono_id) <- mono_infos] + sig_qtvs = [ tv | (_, Just sig, _) <- mono_infos + , (_, tv) <- sig_tvs sig ] ; traceTc "simplifyInfer call" (ppr name_taus $$ ppr wanted) ; (qtvs, givens, _mr_bites, ev_binds) - <- simplifyInfer tclvl mono name_taus wanted + <- simplifyInfer tclvl mono sig_qtvs name_taus wanted ; let inferred_theta = map evVarPred givens ; exports <- checkNoErrs $ |