diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-04-15 10:28:40 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-04-15 10:29:06 +0100 |
commit | 49d9b009a2affb6015b8f6e2f15e4660a53c0d9a (patch) | |
tree | ffc6b19f374e68295b425dce971b8bdf5fd9f3d1 /compiler/typecheck/FunDeps.hs | |
parent | 7b042d5adabdb0fc06286db1a7f9cbf1e9fd1fbf (diff) | |
download | haskell-49d9b009a2affb6015b8f6e2f15e4660a53c0d9a.tar.gz |
Fix fundep coverage-condition check for poly-kinds
See Note [Closing over kinds in coverage] in FunDeps.
I'd already fixed this bug once, for Trac #8391, but I put the
call to closeOverKinds in the wrong place, so Trac #10109
failed. (It checks the /liberal/ coverage condition, which
The fix was easy: move the call to the right place!
Diffstat (limited to 'compiler/typecheck/FunDeps.hs')
-rw-r--r-- | compiler/typecheck/FunDeps.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/typecheck/FunDeps.hs b/compiler/typecheck/FunDeps.hs index 2d0ac33fc9..53ecb48cc7 100644 --- a/compiler/typecheck/FunDeps.hs +++ b/compiler/typecheck/FunDeps.hs @@ -382,11 +382,12 @@ checkInstCoverage be_liberal clas theta inst_taus = NotValid msg where (ls,rs) = instFD fd tyvars inst_taus - ls_tvs = closeOverKinds (tyVarsOfTypes ls) -- See Note [Closing over kinds in coverage] + ls_tvs = tyVarsOfTypes ls rs_tvs = tyVarsOfTypes rs - conservative_ok = rs_tvs `subVarSet` ls_tvs - liberal_ok = rs_tvs `subVarSet` oclose theta ls_tvs + conservative_ok = rs_tvs `subVarSet` closeOverKinds ls_tvs + liberal_ok = rs_tvs `subVarSet` closeOverKinds (oclose theta ls_tvs) + -- closeOverKinds: see Note [Closing over kinds in coverage] msg = vcat [ sep [ ptext (sLit "The") <+> ppWhen be_liberal (ptext (sLit "liberal")) @@ -419,7 +420,7 @@ Example (Trac #8391), using liberal coverage instance Bar a (Foo a) In the instance decl, (a:k) does fix (Foo k a), but only if we notice -that (a:k) fixes k. +that (a:k) fixes k. Trac #10109 is another example. Note [The liberal coverage condition] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |