[commit: ghc] master: Reshuffle levity polymorphism checks. (8906e7b)

git at git.haskell.org git at git.haskell.org
Sun Dec 18 01:01:58 UTC 2016


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

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

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

commit 8906e7b79a585039712034d9e88ca49f3cea6554
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Sat Dec 17 18:06:34 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
    
    Test Plan: ./validate
    
    Reviewers: simonpj, austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2783
    
    GHC Trac Issues: #12819, #12911


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

8906e7b79a585039712034d9e88ca49f3cea6554
 compiler/typecheck/TcSigs.hs                       | 28 +++++++++++++++++-----
 compiler/typecheck/TcTyClsDecls.hs                 |  2 ++
 compiler/typecheck/TcValidity.hs                   | 14 +----------
 compiler/types/Type.hs                             |  5 ++--
 testsuite/tests/patsyn/should_compile/T8968-2.hs   |  2 +-
 .../tests/patsyn/should_compile/poly-export2.hs    |  1 +
 testsuite/tests/patsyn/should_fail/T11010.hs       |  2 +-
 testsuite/tests/patsyn/should_fail/T11039.hs       |  3 +--
 testsuite/tests/patsyn/should_fail/T11039a.hs      |  2 +-
 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 +
 14 files changed, 56 insertions(+), 26 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 8906e7b79a585039712034d9e88ca49f3cea6554


More information about the ghc-commits mailing list