[commit: ghc] master: Fix a nasty superclass expansion bug (43e02d1)

git at git.haskell.org git at git.haskell.org
Mon Feb 8 15:07:57 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/43e02d1270701a1043be67f078cf2b1a85047feb/ghc

>---------------------------------------------------------------

commit 43e02d1270701a1043be67f078cf2b1a85047feb
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Feb 8 14:41:08 2016 +0000

    Fix a nasty superclass expansion bug
    
    This patch fixes Trac #11523.
    
    * The basic problem was that TcRnTypes.superClassesMightHelp was
      returning True of a Derived constraint, and that led to us
      expanding Given superclasses, which produced the same Derived
      constraint again, and so on infinitely.  We really want to do
      this only if there are unsolve /Wanted/ contraints!
    
    * On the way I made TcSMonad.getUnsolvedInerts a bit more
      discriminating about which Derived equalities it returns;
      see Note [Unsolved Derived equalities] in TcSMonad
    
    * Lots of new comments in TcSMonad.


>---------------------------------------------------------------

43e02d1270701a1043be67f078cf2b1a85047feb
 compiler/typecheck/TcRnTypes.hs                    |  58 +++++++-----
 compiler/typecheck/TcSMonad.hs                     | 102 +++++++++++++--------
 testsuite/tests/polykinds/T11523.hs                |  89 ++++++++++++++++++
 testsuite/tests/polykinds/all.T                    |   1 +
 testsuite/tests/typecheck/should_fail/T5853.stderr |  22 ++---
 5 files changed, 199 insertions(+), 73 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 43e02d1270701a1043be67f078cf2b1a85047feb


More information about the ghc-commits mailing list