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

[Bug] Architype Definition Bug for Walkers and Nodes #1320

Open
Thamirawaran opened this issue Sep 27, 2024 · 3 comments
Open

[Bug] Architype Definition Bug for Walkers and Nodes #1320

Thamirawaran opened this issue Sep 27, 2024 · 3 comments

Comments

@Thamirawaran
Copy link
Collaborator

Describe the bug

When defining a walker before the node, Jac throws a NameError: name 'MyWalker' is not defined, and vice versa when the node is defined before the walker. This indicates that the referenced element (either MyWalker or MyNode) is not recognized during execution.

node MyNode;


walker MyWalker{
    can create with `root|MyNode entry{}
}

:node:MyNode{
    can do with MyWalker entry{}
}

NameError: name 'MyWalker' is not defined

walker MyWalker;


node MyNode{
    can do with MyWalker entry{}
}

:walker:MyWalker{
    can create with `root|MyNode entry{}
}

NameError: name 'MyNode' is not defined

@ChrisIsKing
Copy link
Collaborator

I don't see this as a bug. The same would happen in any other language. The example is more of a reflection of how not to cleanly organize your code. Yes jaclang advocates for clean separation of code Implementation from Declaration but a declaration without any suggestion of it abilities or attributes is generally poor design. Even if the intention is for the declaration to be purely abstract, then why declare another object within the same file?

Thoughts @marsninja @ypkang ?

@marsninja
Copy link
Contributor

This is an issue that needs attentione, indeed those types in the with entry/exit should be type annotations that shouldnt create an issue, I think there must be an isinstance somewhere in the generated code that may need to be refactgored out. @Thamirawaran cna you create a pr with a simple test for it (perhaps your w n example) failing. @kugesan1105 can show you how to do this.

@Thamirawaran
Copy link
Collaborator Author

Thamirawaran commented Nov 13, 2024

Issue has been fixed in PR #1357

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

3 participants