-
Notifications
You must be signed in to change notification settings - Fork 22
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
Can't have two modules with the same filename #298
Comments
Yes, this has to do with the way that the compiled code references modules. It's good to register it as an issue. |
I flagged this as wontfix because allowing multiple modules with the same name would require a significant re-work of the way that the compiled code functions are named. At present, they are named |
Submodules are imported with paths relative to the importing module. This fix allows the compiler to find the compiled code when it is created in the same folder as the source. The change is to index the gct cache by module name, rather than path name. This means that it is impossible to import two modules with the same name, but that restriction is also imposed by the gracecode_‹modulename› naming convention for compiled code (#298).
Submodules are imported with paths relative to the importing module. This fix allows the compiler to find the compiled code when it is created in the same folder as the source. The change is to index the gct cache by module name, rather than path name. This means that it is impossible to import two modules with the same name, but that restriction is also imposed by the gracecode_‹modulename› naming convention for compiled code (#298).
When I have two files,
foo.grace
:And
folder/foo.grace
:It fails to compile on
master
(due to issue #295), but compiles on the branch for pull request #297.However it causes a stack overflow at runtime:
Change either of the file names fixes the issue.
The text was updated successfully, but these errors were encountered: