initIface* usage in plugins

Joshmeredith2008 joshmeredith2008 at gmail.com
Sat Feb 27 13:15:56 UTC 2021


      
  

 Hi Ben,
  

  
Yes, I have a solution. For reference, I was unaware that method instances are named with local variables in expression ASTs, while instances and other top-level bindings are - so the solution is to add those Ids to the environment before loading the expression, which isn’t necessary for other top-level bindings that are sourced from the CgGuts cg_binds.
  

  
Cheers,
  
Josh
  
  

  
>   
> On Feb 27, 2021 at 7:34 am,  <Ben Gamari (mailto:ben at smart-cactus.org)>  wrote:
>   
>   
> Josh Meredith writes:  >  Hi,  >  I'm trying to use initIfaceLoad and initIfaceLcl to lookup core `Name`s  >  within a plugin. My understanding is that functions such as  >  `lookupIfaceTop` are used for this, but I'm running into an issue that I  >  suspect is caused by some `Name`s being inappropriate for this function, so  >  they fail with the error `Iface id out of scope: ...`.  >   >  Is there a robust way to select which `Name` lookup function to use based  >  on a core binding/expression?  >  Josh, did you ever get an answer here? Cheers, - Ben
>   
  
  
       
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20210228/41f22b15/attachment.html>


More information about the ghc-devs mailing list