Improve Linting in GHCi (fixes Trac #8215)
The original problem was that we weren't bringing varaibles bound in the interactive context into scope before Linting the result of a top-level declaration in GHCi. (We were doing this for expressions.) Moreover I found that we weren't Linting the result of desugaring a GHCi expression, which we really should be doing. It took me a bit of time to unravel all this, and I did some refactoring to make it easier next time. * CoreMonad contains the Lint wrappers that get the right environments into place. It always had endPass and lintPassResult (which Lints bindings), but now it has lintInteractiveExpr. * Both use a common function CoreMonad.interactiveInScope to find those in-scope variables. Quite a bit of knock-on effects from this, but nothing exciting.
Showing
- compiler/coreSyn/CoreLint.lhs 18 additions, 5 deletionscompiler/coreSyn/CoreLint.lhs
- compiler/coreSyn/CorePrep.lhs 1 addition, 1 deletioncompiler/coreSyn/CorePrep.lhs
- compiler/deSugar/Desugar.lhs 15 additions, 14 deletionscompiler/deSugar/Desugar.lhs
- compiler/main/HscMain.hs 19 additions, 29 deletionscompiler/main/HscMain.hs
- compiler/main/TidyPgm.lhs 1 addition, 1 deletioncompiler/main/TidyPgm.lhs
- compiler/simplCore/CoreMonad.lhs 69 additions, 15 deletionscompiler/simplCore/CoreMonad.lhs
- compiler/simplCore/SimplCore.lhs 8 additions, 7 deletionscompiler/simplCore/SimplCore.lhs
Loading
Please register or sign in to comment