[commit: ghc] master: Improve typechecking of let-bindings (15b9bf4)

git at git.haskell.org git at git.haskell.org
Mon Jun 13 09:53:55 UTC 2016


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

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

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

commit 15b9bf4ba4ab47e6809bf2b3b36ec16e502aea72
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Sat Jun 11 23:49:27 2016 +0100

    Improve typechecking of let-bindings
    
    This major commit was initially triggered by #11339, but it spiraled
    into a major review of the way in which type signatures for bindings
    are handled, especially partial type signatures.  On the way I fixed a
    number of other bugs, namely
       #12069
       #12033
       #11700
       #11339
       #11670
    
    The main change is that I completely reorganised the way in which type
    signatures in bindings are handled. The new story is in TcSigs
    Note [Overview of type signatures].  Some specific:
    
    * Changes in the data types for signatures in TcRnTypes:
      TcIdSigInfo and new TcIdSigInst
    
    * New module TcSigs deals with typechecking type signatures
      and pragmas. It contains code mostly moved from TcBinds,
      which is already too big
    
    * HsTypes: I swapped the nesting of HsWildCardBndrs
      and HsImplicitBndsrs, so that the wildcards are on the
      oustide not the insidde in a LHsSigWcType.  This is just
      a matter of convenient, nothing deep.
    
    There are a host of other changes as knock-on effects, and
    it all took FAR longer than I anticipated :-).  But it is
    a significant improvement, I think.
    
    Lots of error messages changed slightly, some just variants but
    some modest improvements.
    
    New tests
    
    * typecheck/should_compile
        * SigTyVars: a scoped-tyvar test
        * ExPat, ExPatFail: existential pattern bindings
        * T12069
        * T11700
        * T11339
    
    * partial-sigs/should_compile
        * T12033
        * T11339a
        * T11670
    
    One thing to check:
    
    * Small change to output from ghc-api/landmines.
      Need to check with Alan Zimmerman


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

15b9bf4ba4ab47e6809bf2b3b36ec16e502aea72
 compiler/deSugar/DsMeta.hs                         |   14 +-
 compiler/deSugar/DsMonad.hs                        |    1 -
 compiler/ghc.cabal.in                              |    1 +
 compiler/hsSyn/HsTypes.hs                          |   34 +-
 compiler/hsSyn/HsUtils.hs                          |    2 +-
 compiler/rename/RnTypes.hs                         |  184 ++--
 compiler/typecheck/TcBinds.hs                      | 1041 +++++++-------------
 compiler/typecheck/TcClassDcl.hs                   |   45 +-
 compiler/typecheck/TcEnv.hs                        |    2 +-
 compiler/typecheck/TcErrors.hs                     |   20 +-
 compiler/typecheck/TcExpr.hs                       |   88 +-
 compiler/typecheck/TcHsType.hs                     |  306 ++++--
 compiler/typecheck/TcInstDcls.hs                   |   26 +-
 compiler/typecheck/TcMType.hs                      |   59 +-
 compiler/typecheck/TcPat.hs                        |  174 +---
 compiler/typecheck/TcPatSyn.hs                     |  204 +---
 compiler/typecheck/TcPatSyn.hs-boot                |   10 +-
 compiler/typecheck/TcRnDriver.hs                   |    8 +-
 compiler/typecheck/TcRnMonad.hs                    |   41 +-
 compiler/typecheck/TcRnTypes.hs                    |  280 +++---
 compiler/typecheck/TcRules.hs                      |    2 +-
 compiler/typecheck/TcSigs.hs                       |  763 ++++++++++++++
 compiler/typecheck/TcSimplify.hs                   |   66 +-
 compiler/typecheck/TcType.hs                       |   16 +-
 compiler/vectorise/Vectorise/Generic/PData.hs      |    2 +-
 testsuite/tests/arrows/should_fail/T5380.stderr    |    4 +-
 .../tests/dependent/should_compile/T11241.stderr   |    4 +-
 testsuite/tests/deriving/should_fail/T7148.stderr  |    4 +-
 testsuite/tests/deriving/should_fail/T7148a.stderr |    2 +-
 testsuite/tests/gadt/T3169.stderr                  |    2 +-
 testsuite/tests/gadt/T7558.stderr                  |    2 +-
 testsuite/tests/gadt/gadt-escape1.stderr           |    2 +-
 testsuite/tests/gadt/gadt13.stderr                 |    2 +-
 testsuite/tests/gadt/gadt7.stderr                  |    4 +-
 testsuite/tests/gadt/rw.stderr                     |    4 +-
 testsuite/tests/ghc-api/landmines/landmines.stdout |    2 +-
 testsuite/tests/ghci/scripts/Defer02.stderr        |   75 +-
 testsuite/tests/ghci/scripts/T10248.stderr         |    4 +-
 testsuite/tests/ghci/scripts/ghci050.stderr        |    2 +-
 .../indexed-types/should_compile/Simple14.stderr   |    5 +-
 .../indexed-types/should_fail/GADTwrong1.stderr    |    4 +-
 .../indexed-types/should_fail/Overlap6.stderr      |    2 +-
 .../indexed-types/should_fail/SimpleFail5a.stderr  |    2 +-
 .../tests/indexed-types/should_fail/T2664.stderr   |    4 +-
 .../tests/indexed-types/should_fail/T3330a.hs      |    7 +-
 .../tests/indexed-types/should_fail/T3330a.stderr  |    4 +-
 .../tests/indexed-types/should_fail/T3440.stderr   |    4 +-
 .../tests/indexed-types/should_fail/T4093a.stderr  |    2 +-
 .../tests/indexed-types/should_fail/T4093b.stderr  |    2 +-
 .../tests/indexed-types/should_fail/T4174.stderr   |    2 +-
 .../tests/indexed-types/should_fail/T4272.stderr   |    2 +-
 .../tests/indexed-types/should_fail/T7786.stderr   |   38 +-
 .../tests/indexed-types/should_fail/T9662.stderr   |    2 +-
 testsuite/tests/module/mod71.stderr                |    2 +-
 .../should_compile/Defaulting2MROff.stderr         |    2 +-
 .../should_compile/Defaulting2MROn.stderr          |    4 +-
 .../partial-sigs/should_compile/Either.stderr      |    2 +-
 .../partial-sigs/should_compile/EveryNamed.stderr  |    2 +-
 .../should_compile/ExprSigLocal.stderr             |   10 +-
 .../should_compile/ExtraConstraints3.stderr        |    8 +-
 .../partial-sigs/should_compile/SimpleGen.stderr   |    2 +-
 .../partial-sigs/should_compile/SplicesUsed.stderr |   73 +-
 .../partial-sigs/should_compile/SuperCls.stderr    |    4 +-
 .../partial-sigs/should_compile/T10403.stderr      |   28 +-
 .../partial-sigs/should_compile/T10438.stderr      |    6 +-
 .../partial-sigs/should_compile/T10519.stderr      |    8 +-
 .../partial-sigs/should_compile/T11016.stderr      |    9 +-
 .../partial-sigs/should_compile/T11192.stderr      |   20 +-
 .../tests/partial-sigs/should_compile/T11339a.hs   |    6 +
 .../partial-sigs/should_compile/T11339a.stderr     |    6 +
 .../tests/partial-sigs/should_compile/T11670.hs    |   16 +
 .../partial-sigs/should_compile/T11670.stderr      |   36 +
 .../tests/partial-sigs/should_compile/T12033.hs    |   13 +
 .../partial-sigs/should_compile/T12033.stderr      |   24 +
 .../partial-sigs/should_compile/Uncurry.stderr     |    2 +-
 .../should_compile/UncurryNamed.stderr             |    2 +-
 .../WarningWildcardInstantiations.stderr           |   54 +-
 testsuite/tests/partial-sigs/should_compile/all.T  |    3 +
 .../should_fail/Defaulting1MROff.stderr            |    5 +-
 ...xtraConstraintsWildcardInExpressionSignature.hs |    2 +
 ...ConstraintsWildcardInExpressionSignature.stderr |   34 +-
 .../ExtraConstraintsWildcardNotEnabled.stderr      |   10 +-
 .../InstantiatedNamedWildcardsInConstraints.stderr |   18 +-
 .../NamedExtraConstraintsWildcard.stderr           |    8 +-
 .../should_fail/NamedWildcardExplicitForall.stderr |   21 +-
 .../should_fail/NamedWildcardsEnabled.stderr       |   10 +-
 .../should_fail/NamedWildcardsNotEnabled.stderr    |    4 +-
 .../should_fail/NamedWildcardsNotInMonotype.stderr |   10 +-
 .../PartialTypeSignaturesDisabled.stderr           |   10 +-
 .../tests/partial-sigs/should_fail/PatBind3.stderr |    8 +-
 .../tests/partial-sigs/should_fail/T10045.stderr   |    8 +-
 .../tests/partial-sigs/should_fail/T10615.stderr   |   12 +-
 .../tests/partial-sigs/should_fail/T10999.stderr   |   36 +-
 .../tests/partial-sigs/should_fail/T11122.stderr   |    5 +-
 .../tests/partial-sigs/should_fail/T11976.stderr   |    6 +-
 .../partial-sigs/should_fail/TidyClash.stderr      |   18 +-
 .../partial-sigs/should_fail/TidyClash2.stderr     |   46 +-
 .../should_fail/WildcardInstantiations.stderr      |   54 +-
 .../WildcardsInPatternAndExprSig.stderr            |   56 +-
 testsuite/tests/partial-sigs/should_fail/all.T     |    3 +-
 testsuite/tests/patsyn/should_fail/T11010.stderr   |    2 +-
 testsuite/tests/patsyn/should_fail/T11039.stderr   |    2 +-
 testsuite/tests/patsyn/should_fail/T11667.stderr   |    2 +-
 testsuite/tests/polykinds/T10503.stderr            |    2 +-
 testsuite/tests/polykinds/T11399.hs                |    5 +-
 testsuite/tests/polykinds/T11399.stderr            |   10 +-
 testsuite/tests/polykinds/T7438.stderr             |    6 +-
 testsuite/tests/polykinds/T7594.stderr             |    2 +-
 testsuite/tests/polykinds/T9017.stderr             |    2 +-
 .../tests/rename/should_fail/rnfail026.stderr      |    3 +-
 testsuite/tests/th/T10267.stderr                   |   26 +-
 testsuite/tests/typecheck/should_compile/ExPat.hs  |   17 +
 .../tests/typecheck/should_compile/ExPatFail.hs    |   13 +
 .../typecheck/should_compile/ExPatFail.stderr      |   14 +
 .../tests/typecheck/should_compile/FD1.stderr      |    2 +-
 .../tests/typecheck/should_compile/FD2.stderr      |    4 +-
 .../tests/typecheck/should_compile/FD3.stderr      |    2 +-
 .../tests/typecheck/should_compile/SigTyVars.hs    |   12 +
 .../tests/typecheck/should_compile/T10072.stderr   |    2 +-
 .../tests/typecheck/should_compile/T10632.stderr   |    0
 testsuite/tests/typecheck/should_compile/T11339.hs |   32 +
 .../tests/typecheck/should_compile/T11339.stderr   |   15 +
 .../tests/typecheck/should_compile/T11339b.hs      |   32 +
 .../tests/typecheck/should_compile/T11339c.hs      |   32 +
 .../tests/typecheck/should_compile/T11339d.hs      |   15 +
 testsuite/tests/typecheck/should_compile/T11700.hs |   18 +
 testsuite/tests/typecheck/should_compile/T12069.hs |    4 +
 testsuite/tests/typecheck/should_compile/T2357.hs  |   10 +-
 .../tests/typecheck/should_compile/T2494.stderr    |    8 +-
 .../tests/typecheck/should_compile/T9834.stderr    |    4 +-
 .../tests/typecheck/should_compile/T9939.stderr    |    0
 testsuite/tests/typecheck/should_compile/all.T     |    9 +
 .../tests/typecheck/should_compile/holes.stderr    |    2 +-
 .../tests/typecheck/should_compile/holes3.stderr   |    2 +-
 .../tests/typecheck/should_compile/tc141.stderr    |    2 +-
 .../tests/typecheck/should_fail/T10285.stderr      |    4 +-
 .../tests/typecheck/should_fail/T10534.stderr      |    4 +-
 .../tests/typecheck/should_fail/T10715.stderr      |   23 +-
 .../tests/typecheck/should_fail/T11347.stderr      |    4 +-
 testsuite/tests/typecheck/should_fail/T1899.stderr |    2 +-
 testsuite/tests/typecheck/should_fail/T2714.stderr |    2 +-
 testsuite/tests/typecheck/should_fail/T3102.stderr |    2 +-
 testsuite/tests/typecheck/should_fail/T5691.stderr |   28 +-
 testsuite/tests/typecheck/should_fail/T7264.stderr |    2 +-
 .../tests/typecheck/should_fail/T7748a.stderr      |    2 +-
 testsuite/tests/typecheck/should_fail/T7869.stderr |    2 +-
 testsuite/tests/typecheck/should_fail/T8450.stderr |    2 +-
 testsuite/tests/typecheck/should_fail/T9109.stderr |    2 +-
 testsuite/tests/typecheck/should_fail/mc19.stderr  |    2 +-
 testsuite/tests/typecheck/should_fail/mc21.stderr  |    2 +-
 testsuite/tests/typecheck/should_fail/mc22.stderr  |    2 +-
 .../tests/typecheck/should_fail/tcfail032.stderr   |    2 +-
 .../tests/typecheck/should_fail/tcfail065.stderr   |    4 +-
 .../tests/typecheck/should_fail/tcfail068.stderr   |   16 +-
 .../tests/typecheck/should_fail/tcfail076.stderr   |    4 +-
 .../tests/typecheck/should_fail/tcfail103.stderr   |    4 +-
 .../tests/typecheck/should_fail/tcfail131.stderr   |    2 +-
 .../tests/typecheck/should_fail/tcfail153.stderr   |    2 +-
 .../tests/typecheck/should_fail/tcfail174.stderr   |    2 +-
 .../tests/typecheck/should_fail/tcfail175.stderr   |    2 +-
 .../tests/typecheck/should_fail/tcfail179.stderr   |    4 +-
 .../tests/typecheck/should_fail/tcfail191.stderr   |    2 +-
 .../tests/typecheck/should_fail/tcfail193.stderr   |    2 +-
 .../tests/typecheck/should_fail/tcfail198.stderr   |    2 +-
 .../tests/typecheck/should_fail/tcfail201.stderr   |    2 +-
 .../tests/typecheck/should_fail/tcfail206.stderr   |    4 +-
 166 files changed, 2623 insertions(+), 2137 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 15b9bf4ba4ab47e6809bf2b3b36ec16e502aea72


More information about the ghc-commits mailing list