[commit: ghc] master: Fix corner case in typeKind, plus refactoring (f903e55)

git at git.haskell.org git at git.haskell.org
Fri Jun 15 11:12:56 UTC 2018


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

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

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

commit f903e5510d4562fddef1d4140971e2b93a45e45e
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Jun 15 09:19:55 2018 +0100

    Fix corner case in typeKind, plus refactoring
    
    This is a continuation of
    
        commit 9d600ea68c283b0d38ac663c3cc48baba6b94f57
        Author: Simon Peyton Jones <simonpj at microsoft.com>
        Date:   Fri Jun 1 16:36:57 2018 +0100
    
            Expand type synonyms when Linting a forall
    
    That patch pointed out that there was a lurking hole in
    typeKind, where it could return an ill-scoped kind, because
    of not expanding type synonyms enough.
    
    This patch fixes it, quite nicely
    
    * Use occCheckExpand to expand those synonyms (it was always
      designed for that exact purpose), and call it from
             Type.typeKind
             CoreUtils.coreAltType
             CoreLint.lintTYpe
    
    * Consequently, move occCheckExpand from TcUnify.hs to
      Type.hs, and generalise it to take a list of type variables.
    
    I also tidied up lintType a bit.


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

f903e5510d4562fddef1d4140971e2b93a45e45e
 compiler/coreSyn/CoreLint.hs    |  37 ++++-----
 compiler/coreSyn/CoreUtils.hs   |  12 +--
 compiler/typecheck/TcFlatten.hs |   5 +-
 compiler/typecheck/TcUnify.hs   | 153 ++---------------------------------
 compiler/types/Coercion.hs-boot |   1 +
 compiler/types/Type.hs          | 173 +++++++++++++++++++++++++++++++++++++---
 6 files changed, 192 insertions(+), 189 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 f903e5510d4562fddef1d4140971e2b93a45e45e


More information about the ghc-commits mailing list