[commit: ghc] master: Fix #10815 by kind-checking type patterns against known kinds. (2d4db40)

git at git.haskell.org git at git.haskell.org
Sat Sep 19 16:08:05 UTC 2015


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

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

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

commit 2d4db40ac07db2fc776d61aac2383608911281ff
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Mon Aug 31 10:46:01 2015 -0700

    Fix #10815 by kind-checking type patterns against known kinds.
    
    tcFamTyPats now must take information about the instantiation of any
    class variables, when checking the instance of an associated type.
    
    Getting this to work out required some unexpected refactoring in
    TcDeriv. TcDeriv needs to look at class instances because of the
    possibility of associated datatypes with `deriving` specs. TcDeriv
    worked over the user-specified instances. But any data family instances
    were already processed, and TcDeriv had no way of finding the rep
    tycons. Indeed, TcDeriv *re-type-checked* any data family instances
    in an attempt to rediscover what GHC already knew. So, this commit
    introduces better tracking of compiled data families between TcInstDcls
    and TcDeriv to streamline all of this.


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

2d4db40ac07db2fc776d61aac2383608911281ff
 compiler/typecheck/TcDeriv.hs                      | 139 ++++++++++-----------
 compiler/typecheck/TcInstDcls.hs                   |  64 ++++++----
 compiler/typecheck/TcRnDriver.hs                   |   2 +-
 compiler/typecheck/TcTyClsDecls.hs                 |  62 +++++----
 compiler/typecheck/TcValidity.hs                   |  16 +--
 compiler/types/TyCon.hs                            |  16 +--
 testsuite/tests/ghci/scripts/T6018ghcifail.stderr  |  42 +++----
 .../tests/indexed-types/should_compile/T10815.hs   |  15 +++
 testsuite/tests/indexed-types/should_compile/all.T |   1 +
 .../tests/indexed-types/should_fail/T9160.stderr   |   7 +-
 .../tests/typecheck/should_fail/T6018fail.stderr   |  54 ++++----
 11 files changed, 230 insertions(+), 188 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 2d4db40ac07db2fc776d61aac2383608911281ff


More information about the ghc-commits mailing list