Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imported modules skip already imported modules in the chain #17

Open
alinalihassan opened this issue Sep 3, 2022 · 0 comments
Open
Labels
bug Something isn't working help wanted Extra attention is needed LLVM-specific Issues that are related to LLVM or the Code Generation step

Comments

@alinalihassan
Copy link
Owner

Imported modules will skip an import if it's already been added. This makes sense at first, but consider this (common) situation:
We have the main module, in file main.les. Then we have the base module that always gets imported implicitly. And then we want to import another module. Whatever the module is, it won't be able to import base.les again because we already imported it, and it can't use it since we didn't make a way to get the scope from the importer to the imported.

It's not an easy bug to fix, but there might be a couple of ways to fix it. One would be to keep a table of scopes from modules, and import that scope locally when we try an import a file that already exists (but make sure we don't double import).

@alinalihassan alinalihassan added bug Something isn't working help wanted Extra attention is needed labels Sep 3, 2022
@alinalihassan alinalihassan linked a pull request Sep 4, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed LLVM-specific Issues that are related to LLVM or the Code Generation step
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

1 participant