How to set idScope properly when converting LhsExpr GhcPs to CoreExpr?
liuyiyun at terpmail.umd.edu
Wed Aug 25 20:16:01 UTC 2021
We have a function in Liquidhaskell's code base for converting
refinement expressions into GHC's core expressions using the GHC API.
Its implementation is based on tcRnExpr
we keep the typechecked expression and desugar it before returning.
However, our function fails to set the idScope information properly when
LiquidHaskell is invoked as a plugin (installed as a
typeCheckResultAction). This repo
<https://github.com/yiyunliu/ghc-elaboration-test>contains a minimal
example that demonstrates the issue. In the CoreExpr returned by
every symbol from the current module that's being compiled is labeled as
local. The README.md file shows how the exported symbol testPlus is
marked as local in QQQ.hs, the module where it's defined.
Is there a function we should call to set the idScope information properly?
More information about the ghc-devs