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

topoSort implementation is wrong #1

Open
jdmansour opened this issue Dec 29, 2015 · 0 comments
Open

topoSort implementation is wrong #1

jdmansour opened this issue Dec 29, 2015 · 0 comments

Comments

@jdmansour
Copy link
Owner

We make parent classes appear earlier than derived classes in the generated code. To do this, we perform a topological sort on the list of "objects" - placing each class after its dependencies.

The code for the sort (topoSort function in smartgi.nim) is wrong, and only sorts partially. To get the list properly sorted, I have to run it multiple times. It should be straightforward to replace it with a correct implementation.

Note I wonder why this sorting is necessary at all - you should be able to put multiple type declarations in one type block which depend on each other. However, without sorting I get an error message "inheritance only works with non-final objects" in the generated GObject2.nim. The compiler sees that something inherits from TObject, before it sees that TObject inherits from TRoot, which is inheritable.

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

1 participant