[commit: ghc] master: Fix #15637 by using VTA more in GND (309438e)

git at git.haskell.org git at git.haskell.org
Mon Oct 1 16:48:54 UTC 2018


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

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

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

commit 309438e948359a0ae71ffac4a41ebcd855cf5657
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Mon Oct 1 12:00:52 2018 -0400

    Fix #15637 by using VTA more in GND
    
    Summary:
    The code that GND was generating before could crumple over
    if it derived an instance for a class with an ambiguous type variable
    in the class head, such as the example in #15637. The solution is
    straightforward: simply instantiate all variables bound by the class
    head explicitly using visible type application, which will nip any
    ambiguity in the bud.
    
    Test Plan: make test TEST=T15637
    
    Reviewers: bgamari, simonpj, goldfire
    
    Reviewed By: simonpj
    
    Subscribers: simonpj, rwbarton, carter
    
    GHC Trac Issues: #15637
    
    Differential Revision: https://phabricator.haskell.org/D5148


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

309438e948359a0ae71ffac4a41ebcd855cf5657
 compiler/typecheck/FamInst.hs                      | 12 ++--
 compiler/typecheck/TcGenDeriv.hs                   | 46 +++++++++++++-
 compiler/typecheck/TcTyClsDecls.hs                 | 11 ++--
 compiler/typecheck/TcValidity.hs                   |  4 +-
 compiler/types/Type.hs                             | 73 +++++++++++++---------
 .../tests/deriving/should_compile/T14578.stderr    | 26 +++++---
 testsuite/tests/deriving/should_compile/T15637.hs  |  9 +++
 testsuite/tests/deriving/should_compile/all.T      |  1 +
 testsuite/tests/deriving/should_fail/T15073.stderr |  4 +-
 testsuite/tests/deriving/should_fail/T4846.stderr  |  6 +-
 10 files changed, 137 insertions(+), 55 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 309438e948359a0ae71ffac4a41ebcd855cf5657


More information about the ghc-commits mailing list