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
Showing
- compiler/deSugar/DsMeta.hs 7 additions, 7 deletionscompiler/deSugar/DsMeta.hs
- compiler/deSugar/DsMonad.hs 0 additions, 1 deletioncompiler/deSugar/DsMonad.hs
- compiler/ghc.cabal.in 1 addition, 0 deletionscompiler/ghc.cabal.in
- compiler/hsSyn/HsTypes.hs 14 additions, 20 deletionscompiler/hsSyn/HsTypes.hs
- compiler/hsSyn/HsUtils.hs 1 addition, 1 deletioncompiler/hsSyn/HsUtils.hs
- compiler/rename/RnTypes.hs 80 additions, 104 deletionscompiler/rename/RnTypes.hs
- compiler/typecheck/TcBinds.hs 331 additions, 710 deletionscompiler/typecheck/TcBinds.hs
- compiler/typecheck/TcClassDcl.hs 23 additions, 22 deletionscompiler/typecheck/TcClassDcl.hs
- compiler/typecheck/TcEnv.hs 1 addition, 1 deletioncompiler/typecheck/TcEnv.hs
- compiler/typecheck/TcErrors.hs 10 additions, 10 deletionscompiler/typecheck/TcErrors.hs
- compiler/typecheck/TcExpr.hs 57 additions, 31 deletionscompiler/typecheck/TcExpr.hs
- compiler/typecheck/TcHsType.hs 204 additions, 102 deletionscompiler/typecheck/TcHsType.hs
- compiler/typecheck/TcInstDcls.hs 17 additions, 9 deletionscompiler/typecheck/TcInstDcls.hs
- compiler/typecheck/TcMType.hs 24 additions, 35 deletionscompiler/typecheck/TcMType.hs
- compiler/typecheck/TcPat.hs 46 additions, 128 deletionscompiler/typecheck/TcPat.hs
- compiler/typecheck/TcPatSyn.hs 18 additions, 186 deletionscompiler/typecheck/TcPatSyn.hs
- compiler/typecheck/TcPatSyn.hs-boot 3 additions, 7 deletionscompiler/typecheck/TcPatSyn.hs-boot
- compiler/typecheck/TcRnDriver.hs 3 additions, 5 deletionscompiler/typecheck/TcRnDriver.hs
- compiler/typecheck/TcRnMonad.hs 27 additions, 14 deletionscompiler/typecheck/TcRnMonad.hs
- compiler/typecheck/TcRnTypes.hs 111 additions, 169 deletionscompiler/typecheck/TcRnTypes.hs
Loading
Please register or sign in to comment