-
Notifications
You must be signed in to change notification settings - Fork 26
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
Include guards missing - can't import same bundle twice in a dependency tree #329
Comments
I do mean to address this as a part of the module system, but development is (too) slow. |
Would inserting |
Perhaps .. maybe you could try on the generated C. |
The duplication is caught during typechecking, though, so you would have to turn that off before getting any generated C... |
Argh! |
@Bearmarshal: I'm pretty sure there is only ever a single .h file generated, even when including modules. |
You are right. I guess that makes stuff less trivial then... Perhaps surrounding all declarations made by a single bundle with
I assume this would require some additional work, though, like keeping a separate list of declarations per |
What are the arguments for not using multiple .h files? |
One way forward could be to check for duplicate classes when merging the class tables of different modules, and if they are from the same file, only keep one of them (and in the other case, rightfully give an error message and wait for @supercooldave's module system to provide namespaces). This information should be available in the |
@Bearmarshal: As far as I can see, your problem is not at the C-level (yet) but rather on the Encore level. The simplest solution would be one that only required changes to one of them. |
I've actually promised myself to not dig into the compiler source code (I would probably disappear from the face of Earth for a month if I did), so I'll wait. |
@Bearmarshal: But you want to get rid of the |
Yes, I want. And no, I'm not. |
There seem to be no include guards in any of the generated C files, leading to problems with a nestled dependency tree, such as the following:
The error is trivial to trigger, just import the same bunde twice in a file:
This also causes a circular dependency to throw the compiler into an infinite loop:
The text was updated successfully, but these errors were encountered: