[commit: ghc] wip/rae: Fix #10815 by kind-checking type patterns against known kinds. (b749816)

git at git.haskell.org git at git.haskell.org
Sat Sep 19 02:51:56 UTC 2015


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

On branch  : wip/rae
Link       : http://ghc.haskell.org/trac/ghc/changeset/b749816dbfdea98a558a8f3728ebaeab40180dc4/ghc

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

commit b749816dbfdea98a558a8f3728ebaeab40180dc4
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.


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

b749816dbfdea98a558a8f3728ebaeab40180dc4
 compiler/typecheck/TcDeriv.hs                      | 114 +++++++++++++--------
 compiler/typecheck/TcInstDcls.hs                   |  46 +++++----
 compiler/typecheck/TcTyClsDecls.hs                 |  41 +++++---
 compiler/typecheck/TcValidity.hs                   |  16 +--
 compiler/types/TyCon.hs                            |  16 ++-
 libraries/Cabal                                    |   2 +-
 libraries/array                                    |   2 +-
 libraries/hpc                                      |   2 +-
 libraries/stm                                      |   2 +-
 .../tests/indexed-types/should_compile/T10815.hs   |  11 ++
 testsuite/tests/indexed-types/should_compile/all.T |   1 +
 .../tests/indexed-types/should_fail/T9160.stderr   |   7 +-
 utils/haddock                                      |   2 +-
 13 files changed, 156 insertions(+), 106 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 b749816dbfdea98a558a8f3728ebaeab40180dc4


More information about the ghc-commits mailing list