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

git at git.haskell.org git at git.haskell.org
Sat Sep 19 03:00:18 UTC 2015


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

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

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

commit 4d48a25d44c4ae9b458f9d1ee8cc91aceb48450b
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.


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

4d48a25d44c4ae9b458f9d1ee8cc91aceb48450b
 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 ++-
 .../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 +-
 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 4d48a25d44c4ae9b458f9d1ee8cc91aceb48450b


More information about the ghc-commits mailing list