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

Variables can be redefined without erroring #20

Open
dragoncoder047 opened this issue May 10, 2022 · 2 comments
Open

Variables can be redefined without erroring #20

dragoncoder047 opened this issue May 10, 2022 · 2 comments

Comments

@dragoncoder047
Copy link

So I finally got Fusion.ruel to compile without errors... but then I checked the output and noticed a problem.

Lines 83-91 of the output reference a variable called anyNTAAHead.0, but it was never defined anywhere else in the file, but it was used in the Nutshell file. (It should be var anyNTAAHead.0 = {7,8}.)

What is causing this and how do I fix it?

dragoncoder047 added a commit to dragoncoder047/wiki that referenced this issue May 10, 2022
dragoncoder047 added a commit to dragoncoder047/wiki that referenced this issue May 10, 2022
dragoncoder047 added a commit to dragoncoder047/wiki that referenced this issue May 10, 2022
manually patch in missing variable
@supposedly
Copy link
Owner

supposedly commented May 10, 2022

Wow, this is weird. It looks like it's getting tripped up because you're defining anyNTAAHead twice (once on line 28, once on line 32).

Maybe the second definition is overwriting the first but without updating references to it or something? I don't know why I never accounted for this. Still, the output behaves correctly if you delete the second anyNTAAHead = ... line.

@supposedly supposedly changed the title Not outputting all variables Variables can be redefined without erroring May 10, 2022
dragoncoder047 added a commit to dragoncoder047/wiki that referenced this issue May 10, 2022
@dragoncoder047
Copy link
Author

Gosh, I didn't think that was the problem. I didn't notice I had two definitions for the same variable.

IMO I think that the expected behavior in this case (if the expected behavior is not an error) would be transitions above the redefinition should use the old definition, and those below would use the new one like a variable in Python. But having the same variable mean two different things in two different places seems very confusing.

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