-
- Downloads
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
Showing
- compiler/ghci/Debugger.hs 3 additions, 3 deletionscompiler/ghci/Debugger.hs
- compiler/main/HscMain.hs 9 additions, 9 deletionscompiler/main/HscMain.hs
- compiler/main/HscTypes.hs 63 additions, 21 deletionscompiler/main/HscTypes.hs
- compiler/main/InteractiveEval.hs 5 additions, 7 deletionscompiler/main/InteractiveEval.hs
- compiler/main/TidyPgm.hs 4 additions, 4 deletionscompiler/main/TidyPgm.hs
- compiler/typecheck/FamInst.hs 5 additions, 6 deletionscompiler/typecheck/FamInst.hs
- compiler/typecheck/Inst.hs 9 additions, 8 deletionscompiler/typecheck/Inst.hs
- compiler/typecheck/TcRnDriver.hs 0 additions, 2 deletionscompiler/typecheck/TcRnDriver.hs
- compiler/typecheck/TcRnTypes.hs 3 additions, 2 deletionscompiler/typecheck/TcRnTypes.hs
- compiler/types/FamInstEnv.hs 5 additions, 5 deletionscompiler/types/FamInstEnv.hs
- compiler/types/InstEnv.hs 7 additions, 6 deletionscompiler/types/InstEnv.hs
- docs/users_guide/ghci.xml 4 additions, 3 deletionsdocs/users_guide/ghci.xml
Loading
Please register or sign in to comment