How to set idScope properly when converting LhsExpr GhcPs to CoreExpr?

Yiyun Liu liuyiyun at
Wed Aug 25 20:16:01 UTC 2021

Hi all,

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
<>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 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 mailing list