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

DAG dependency throws an error #233

Closed
kikofernandez opened this issue Oct 2, 2015 · 3 comments
Closed

DAG dependency throws an error #233

kikofernandez opened this issue Oct 2, 2015 · 3 comments
Assignees
Milestone

Comments

@kikofernandez
Copy link
Contributor

The following example throws an error due to duplicate definition of a class List.
The error happens because we are importing the list file from two different files, namely main.enc and sss.enc.

-- file: main.enc
import list
import sss

class Main
  def main(): void
    new X
--file: list.enc
class List
  def x(): void
    ()
--file: sss.enc
import list

class X
  def x(): void
    ()
@supercooldave
Copy link

Currently, the module implementation is not more sophisticated than a hash-include, so anything imported multiple times is included multiple times in the generated code.
It should be relatively easy to fix this – when I find time.

@supercooldave supercooldave self-assigned this Oct 13, 2015
@kikofernandez
Copy link
Contributor Author

hi there, I have a half solution to this issue. it's in the branch features/module-include in my fork. This could be considered as a temporary patch if we want to have something working for the plenary. The main idea is to put all the imports in the Main class and some more mangling that I do... but not much.
So far, the example given above can run and compile (there might be some more bugs... you are welcome to help)

Shortcomings:

  • Classes have unique names, you cannot create two classes with the same name in different modules
  • same for functions

As I said, it's not ideal... but it's something :)

P.S. there might some other unknown bugs. If this is not helpful because we want to do it right from the beginning (whatever right means...), this is a prototype and we can throw it away

@kikofernandez
Copy link
Contributor Author

closed by #443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants