Fix for context propagation in the presence of circular imports#204
Merged
agarciadom merged 2 commits intomainfrom Oct 1, 2025
Merged
Fix for context propagation in the presence of circular imports#204agarciadom merged 2 commits intomainfrom
agarciadom merged 2 commits intomainfrom
Conversation
Suppose we have this situation: * circular1.egl imports circular2.egl. * circular2.egl imports circular1.egl. * We load and parse circular1.egl as the root module. In this scenario, we want circular1.egl to be in the ImportManager cache before parsing circular2.egl, so that it will be reused when parsing circular2.egl. This prevents the creation of a throwaway EglModule while parsing circular2.egl (which is not used anyway, due to the loop over the ancestors which is done in Import::load).
Contributor
Author
|
I have added a commit that ensures that the importing module is in the cache before parsing the imported module, so that it is reused down the import tree if necessary. |
Contributor
Author
|
Reviewed and approved by @kolovos today. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a suggested fix for #203. It removes the clobbering of module contexts in EolModule::build(), and instead propagates the context via the Import::load() method.
This works more reliably in the presence of circular imports, as the parent module's context is present from the start while parsing the imported module.