[commit: ghc] wip/T12819: Reshuffle levity polymorphism checks. (37bb95b)

git at git.haskell.org git at git.haskell.org
Thu Dec 1 22:31:20 UTC 2016


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

On branch  : wip/T12819
Link       : http://ghc.haskell.org/trac/ghc/changeset/37bb95bb57024c60b4eb7eef040efcedadf89894/ghc

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

commit 37bb95bb57024c60b4eb7eef040efcedadf89894
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


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

37bb95bb57024c60b4eb7eef040efcedadf89894
 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/all.T           |  1 +
 testsuite/tests/typecheck/should_compile/T12911.hs |  9 +++++++
 testsuite/tests/typecheck/should_compile/all.T     |  1 +
 8 files changed, 48 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 37bb95bb57024c60b4eb7eef040efcedadf89894


More information about the ghc-commits mailing list