[commit: ghc] master: Fix #13983 by creating a TyConFlavour type, and using it (6e3c901)

git at git.haskell.org git at git.haskell.org
Wed Jul 19 23:29:29 UTC 2017


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

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

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

commit 6e3c901db7a624d030614113c51be5731d1ac862
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Wed Jul 19 15:07:01 2017 -0400

    Fix #13983 by creating a TyConFlavour type, and using it
    
    An error message was referring to a type synonym as a datatype.
    Annoyingly, learning that the TyCon over which the error message is
    operating is actually a type synonym was previously impossible, since
    that code only had access to a TcTyCon, which doesn't retain any
    information about what sort of TyCon it is.
    
    To rectify this, I created a new TyConFlavour datatype, intended to
    capture roughly what sort of TyCon we're dealing with. I then performing
    the necessary plumbing to ensure all TcTyCons have a TyConFlavour, and
    propagated this information through to the relevant error message.
    
    Test Plan: ./validate
    
    Reviewers: goldfire, austin, bgamari, simonpj
    
    Reviewed By: simonpj
    
    Subscribers: simonpj, rwbarton, thomie
    
    GHC Trac Issues: #13983
    
    Differential Revision: https://phabricator.haskell.org/D3747


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

6e3c901db7a624d030614113c51be5731d1ac862
 compiler/typecheck/TcHsType.hs                     |  28 ++---
 compiler/typecheck/TcPat.hs                        |   4 +-
 compiler/typecheck/TcTyClsDecls.hs                 |  41 ++++---
 compiler/typecheck/TcValidity.hs                   |   8 +-
 compiler/types/TyCon.hs                            | 128 ++++++++++++++++-----
 testsuite/tests/ghci/scripts/T7873.stderr          |   2 +-
 testsuite/tests/typecheck/should_fail/T13983.hs    |   7 ++
 .../tests/typecheck/should_fail/T13983.stderr      |   8 ++
 testsuite/tests/typecheck/should_fail/all.T        |   1 +
 9 files changed, 161 insertions(+), 66 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 6e3c901db7a624d030614113c51be5731d1ac862


More information about the ghc-commits mailing list