<div dir="ltr">Yes, based on Michael's reasoning inĀ <a href="https://gitlab.haskell.org/ghc/ghc/-/wikis/Core-interface-section">https://gitlab.haskell.org/ghc/ghc/-/wikis/Core-interface-section</a>, I want to round-trip the entire ModGuts, and this part of the mg_binds is giving me trouble.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 18 May 2020 at 03:05, Matthew Pickering <<a href="mailto:matthewtpickering@gmail.com">matthewtpickering@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">So we are clear here you are trying to store additional core bindings<br>
other than the ones stored normally in the interface files?<br>
<br>
It sounds like to me you might need to use `forkM` to make your custom<br>
loading lazier.<br>
<br>
On Sun, May 17, 2020 at 5:55 PM Josh Meredith<br>
<<a href="mailto:joshmeredith2008@gmail.com" target="_blank">joshmeredith2008@gmail.com</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> In attempting to implement an extensible interface field for Core bindings based<br>
> on my previous interfaces patch, I've run into problems with deserialising the<br>
> special type reflection `$trModule` bindings generated by `GHC.Tc.Instance.Typeable.mkTypeableBinds`.<br>
> These bindings are then stored in the `ModGuts.mg_binds` along with the real exported<br>
> top-level bindings of the module.<br>
><br>
> Specifically, attempting to load the iface right-hand side expressions with<br>
> `tcIfaceExpr` results in the error "Iface id out of scope" from `GHC.Iface.Env.tcIfaceLclId`.<br>
> My understanding is that this may be because the binding is attempting to look<br>
> itself up within the interface loading environment, without being bound yet -<br>
> though it's unclear to me whether this is the correct behaviour for these special<br>
> type reflection bindings, or if there's some special treatment that should be<br>
> instead applied to load these.<br>
><br>
> Any advice on how I should proceed would be greatly appreciated.<br>
><br>
> Cheers,<br>
> Josh<br>
> _______________________________________________<br>
> ghc-devs mailing list<br>
> <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div>