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

git at git.haskell.org git at git.haskell.org
Sat Sep 19 02:13:33 UTC 2015


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

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

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

commit 23a228e80ec719be1a36793b93de168e5fa0b913
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.


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

23a228e80ec719be1a36793b93de168e5fa0b913
 compiler/typecheck/TcDeriv.hs                      | 114 +++++++++++++--------
 compiler/typecheck/TcInstDcls.hs                   |  46 +++++----
 compiler/typecheck/TcTyClsDecls.hs                 |  41 +++++---
 compiler/typecheck/TcValidity.hs                   |  15 +--
 compiler/types/TyCon.hs                            |  16 ++-
 .../tests/indexed-types/should_compile/T10815.hs   |  11 ++
 testsuite/tests/indexed-types/should_compile/all.T |   2 +-
 .../tests/indexed-types/should_fail/T9160.stderr   |   7 +-
 8 files changed, 151 insertions(+), 101 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 23a228e80ec719be1a36793b93de168e5fa0b913


More information about the ghc-commits mailing list