[commit: ghc] wip/rae: Reshuffle levity polymorphism checks. (afb9c30)

git at git.haskell.org git at git.haskell.org
Mon Dec 12 13:18:47 UTC 2016


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

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

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

commit afb9c30bd16645b56189c6d1deb9db64e16b9136
Author: Richard Eisenberg <rae at cs.brynmawr.edu>
Date:   Thu Nov 10 13:41:30 2016 -0500

    Reshuffle levity polymorphism checks.
    
    Previously, GHC checked for bad levity polymorphism to the
    left of all arrows in data constructors. This was wrong, as
    reported in #12911 (where an example is also shown). The solution
    is to check each individual argument for bad levity polymorphism.
    Thus the check has been moved from TcValidity to TcTyClsDecls.
    
    A similar situation exists with pattern synonyms, also fixed here.
    
    This patch also nabs #12819 while I was in town.
    
    Test cases: typecheck/should_compile/T12911, patsyn/should_fail/T12819


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

afb9c30bd16645b56189c6d1deb9db64e16b9136
 compiler/typecheck/TcSigs.hs                       | 28 +++++++++++++++++-----
 compiler/typecheck/TcTyClsDecls.hs                 |  2 ++
 compiler/typecheck/TcValidity.hs                   | 14 +----------
 compiler/types/Type.hs                             |  5 ++--
 testsuite/tests/patsyn/should_fail/T12819.hs       |  9 +++++++
 testsuite/tests/patsyn/should_fail/T12819.stderr   |  3 +++
 testsuite/tests/patsyn/should_fail/all.T           |  1 +
 testsuite/tests/typecheck/should_compile/T12911.hs |  9 +++++++
 testsuite/tests/typecheck/should_compile/all.T     |  1 +
 9 files changed, 51 insertions(+), 21 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 afb9c30bd16645b56189c6d1deb9db64e16b9136


More information about the ghc-commits mailing list