We've been hitting some edge cases where we need to do post-loop processing, like resolving instance variable references and attaching them to their respective declarations. I'm starting to suspect that there's actually a better way to structure this if we include everything inside the loop.
We originally set things up as resolution loop + handle other definitions to ensure dependency ordering. If we find an unresolved constant reference while handling other definitions, we know we couldn't resolve it for sure. The problem is that we're now getting more and more post steps, like handling method visibility and instance variable references.
We might be able to merge everything into a single loop, which can hopefully simplify some of these steps. It may require better dependency tracking or sorting of operations. Investigate if this is possible and if the trade offs are favourable. Do we get better performance? Is the code easier to manage?
We've been hitting some edge cases where we need to do post-loop processing, like resolving instance variable references and attaching them to their respective declarations. I'm starting to suspect that there's actually a better way to structure this if we include everything inside the loop.
We originally set things up as
resolution loop+handle other definitionsto ensure dependency ordering. If we find an unresolved constant reference while handling other definitions, we know we couldn't resolve it for sure. The problem is that we're now getting more and more post steps, like handling method visibility and instance variable references.We might be able to merge everything into a single loop, which can hopefully simplify some of these steps. It may require better dependency tracking or sorting of operations. Investigate if this is possible and if the trade offs are favourable. Do we get better performance? Is the code easier to manage?