[commit: ghc] master: More refactoring in TcValidity (fd0f033)

git at git.haskell.org git at git.haskell.org
Tue Jul 10 11:45:19 UTC 2018


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

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

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

commit fd0f0334189c0c5c9b186bd1b009f706d3d86086
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Jul 5 17:09:47 2018 +0100

    More refactoring in TcValidity
    
    This patch responds to Trac #15334 by making it an error to
    write an instance declaration for a tuple constraint like
    (Eq [a], Show [a]).
    
    I then discovered that instance validity checking was
    scattered betweeen TcInstDcls and TcValidity, so I took
    the time to bring it all together, into
      TcValidity.checkValidInstHead
    
    In doing so I discovered that there are lot of special
    cases.   I have not changed them, but at least they are
    all laid out clearly now.


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

fd0f0334189c0c5c9b186bd1b009f706d3d86086
 compiler/hsSyn/HsDecls.hs                          |   4 +-
 compiler/prelude/TysWiredIn.hs                     |   2 +-
 compiler/typecheck/TcDeriv.hs                      |  20 +-
 compiler/typecheck/TcInstDcls.hs                   |  60 +-----
 compiler/typecheck/TcTyClsDecls.hs                 |   2 +-
 compiler/typecheck/TcType.hs                       |   7 +-
 compiler/typecheck/TcValidity.hs                   | 203 ++++++++++++++-------
 testsuite/tests/deriving/should_fail/T14916.stderr |   6 +-
 testsuite/tests/deriving/should_fail/T9687.stderr  |   2 +-
 testsuite/tests/polykinds/T8132.stderr             |   2 +-
 testsuite/tests/quantified-constraints/T15334.hs   |   9 +
 .../tests/quantified-constraints/T15334.stderr     |   6 +
 testsuite/tests/quantified-constraints/all.T       |   1 +
 .../tests/typecheck/should_fail/T12837.stderr      |   6 +-
 .../tests/typecheck/should_fail/T13068.stderr      |   2 +-
 .../tests/typecheck/should_fail/T14390.stderr      |   3 +-
 .../typecheck/should_fail/TcCoercibleFail2.stderr  |   5 +-
 17 files changed, 196 insertions(+), 144 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 fd0f0334189c0c5c9b186bd1b009f706d3d86086


More information about the ghc-commits mailing list