[commit: ghc] master: Fix #10045 (e9d72ce)

git at git.haskell.org git at git.haskell.org
Thu Feb 19 01:18:08 UTC 2015


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

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

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

commit e9d72cefeda243d5962d0615fe7ad22ff615d134
Author: Thomas Winant <thomas.winant at cs.kuleuven.be>
Date:   Wed Feb 18 10:13:37 2015 -0600

    Fix #10045
    
    Summary:
    SPJ's solution is to only bring the `TcId` (which includes the type) of a
    binder into scope when it had a non-partial type signature.
    
    Take care of this by only storing the `TcId` in `TcSigInfo` of non-partial
    type signatures, hence the change to `sig_poly_id :: Maybe TcId`. Only in case
    of a `Just` will we bring the `TcId` in scope. We still need to know the name
    of the binder, even when it has a partial type signature, so add a `sig_name
    :: Name` field. The field `sig_partial :: Bool` is no longer necessary, so
    reimplement `isPartialSig` in terms of `sig_poly_id`.
    
    Note that the new test case fails, but not because of a panic, but because the
    `Num a` constraint is missing. Adding an extra-constraints wildcard to
    `copy`'s signature would fix it.
    
    Test Plan: validate
    
    Reviewers: simonpj, austin
    
    Reviewed By: simonpj
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D646
    
    GHC Trac Issues: #10045


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

e9d72cefeda243d5962d0615fe7ad22ff615d134
 compiler/typecheck/TcBinds.hs                      | 55 ++++++++++++----------
 compiler/typecheck/TcClassDcl.hs                   |  7 ++-
 compiler/typecheck/TcInstDcls.hs                   | 10 ++--
 compiler/typecheck/TcPat.hs                        | 54 ++++++++++++++++-----
 .../tests/partial-sigs/should_fail/Trac10045.hs    |  8 ++++
 .../partial-sigs/should_fail/Trac10045.stderr      | 45 ++++++++++++++++++
 testsuite/tests/partial-sigs/should_fail/all.T     |  1 +
 7 files changed, 139 insertions(+), 41 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 e9d72cefeda243d5962d0615fe7ad22ff615d134


More information about the ghc-commits mailing list