[commit: ghc] master: Fix GHCi/GHC-API tidying and modules (Trac #9424, #9426) (67a0cab)

git at git.haskell.org git at git.haskell.org
Wed Dec 17 14:45:47 UTC 2014


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

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

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

commit 67a0cab6b501e2d6280b51655af66ad448b3deef
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Dec 16 17:46:06 2014 +0000

    Fix GHCi/GHC-API tidying and modules (Trac #9424, #9426)
    
    There were two related bugs here
    
    Trac #9426
       We must increment the ic_mod_index field of the InteractiveContext
       if we have new instances, because we maek DFunIds that should be
       distinct from previous ones.  Previously we were only incrementing
       when defining new user-visible Ids.
    
       The main change is in HscTypes.extendInteractiveContext, which now
       alwyas bumps the ic_mod_index.  I also added a specialised
       extendInteractiveContextWithIds for the case where we are *only*
       adding new user-visible Ids.
    
    Trac #9424
       In HscMain.hscDeclsWithLocations we were failing to use the
       *tidied* ClsInsts; but the un-tidied ones are LocalIds which
       causes a later ASSERT error.
    
       On the way I realised that, to behave consistently, the tcg_insts
       and tcg_fam_insts field of TcGblEnv should really only contain
       instances from the current GHCi command, not all the ones to date.
       That in turn meant I had to move the code for deleting replacement
       instances from addLocalInst, addLocalFamInst to
       HscTypes.extendInteractiveContext


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

67a0cab6b501e2d6280b51655af66ad448b3deef
 compiler/ghci/Debugger.hs        |  6 +--
 compiler/main/HscMain.hs         | 18 ++++-----
 compiler/main/HscTypes.hs        | 84 ++++++++++++++++++++++++++++++----------
 compiler/main/InteractiveEval.hs | 12 +++---
 compiler/main/TidyPgm.hs         |  8 ++--
 compiler/typecheck/FamInst.hs    | 11 +++---
 compiler/typecheck/Inst.hs       | 17 ++++----
 compiler/typecheck/TcRnDriver.hs |  2 -
 compiler/typecheck/TcRnTypes.hs  |  5 ++-
 compiler/types/FamInstEnv.hs     | 10 ++---
 compiler/types/InstEnv.hs        | 13 ++++---
 docs/users_guide/ghci.xml        |  7 ++--
 12 files changed, 117 insertions(+), 76 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 67a0cab6b501e2d6280b51655af66ad448b3deef


More information about the ghc-commits mailing list