[commit: ghc] ghc-8.4: Fix two more bugs in partial signatures (3d2664e)
git at git.haskell.org
git at git.haskell.org
Sun Jan 14 22:08:01 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.4
Link : http://ghc.haskell.org/trac/ghc/changeset/3d2664e4d97fde24f4a70d3fd106618d41c55776/ghc
>---------------------------------------------------------------
commit 3d2664e4d97fde24f4a70d3fd106618d41c55776
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Tue Jan 9 16:20:46 2018 +0000
Fix two more bugs in partial signatures
These were shown up by Trac #14643
Bug 1: if we had a single partial signature for
two functions
f, g :: forall a. _ -> a
then we made two different SigTvs but with the sane Name.
This was jolly confusing and ultimately led to deeply bogus
results with Any's appearing in the resulting program. Yikes.
Fix: clone the quantified variables in TcSigs.tcInstSig (as
indeed its name suggests).
Bug 2: we were not eliminating duplicate/superclass constraints
in the partial signatures of a mutually recursive group.
Easy to fix: we are already doing dup/superclass elim in
TcSimplify.decideQuantification. So we move the partial-sig
constraints there too.
(cherry picked from commit 1577908f2a9db0fcf6f749d40dd75481015f5497)
>---------------------------------------------------------------
3d2664e4d97fde24f4a70d3fd106618d41c55776
compiler/typecheck/TcHsType.hs | 10 ++---
compiler/typecheck/TcMType.hs | 34 +++++++++-------
compiler/typecheck/TcSigs.hs | 24 ++++++++++--
compiler/typecheck/TcSimplify.hs | 45 +++++++++++++---------
.../tests/partial-sigs/should_compile/T14643.hs | 9 +++++
.../partial-sigs/should_compile/T14643.stderr | 8 ++++
.../tests/partial-sigs/should_compile/T14643a.hs | 9 +++++
.../partial-sigs/should_compile/T14643a.stderr | 8 ++++
testsuite/tests/partial-sigs/should_compile/all.T | 7 +++-
.../tests/partial-sigs/should_fail/T14040a.stderr | 2 +-
testsuite/tests/partial-sigs/should_fail/all.T | 2 +-
11 files changed, 113 insertions(+), 45 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 3d2664e4d97fde24f4a70d3fd106618d41c55776
More information about the ghc-commits
mailing list