-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
Loop and variable bug #2825
Labels
Comments
That does seem to be the case... |
Actually, a separate local variable is created, but it shadows the first one. See here. Lines 36-39 would be the |
CountBleck
added a commit
to CountBleck/assemblyscript
that referenced
this issue
Mar 10, 2024
It turns out that incrementors were compiled with the body's flow, which meant that the incrementor had access to local variables declared in the body. Now, code like this should no longer compile: for (let i = 0; i < 2; j++) { let j = 0; } Fixes AssemblyScript#2825.
2 tasks
CountBleck
added a commit
to CountBleck/assemblyscript
that referenced
this issue
Mar 10, 2024
It turns out that incrementors were compiled with the body's flow, which meant that the incrementor had access to local variables declared in the body. Now, incrementors no longer have access to such variables. Fixes AssemblyScript#2825.
CountBleck
added a commit
to CountBleck/assemblyscript
that referenced
this issue
Mar 10, 2024
It turns out that incrementors were compiled with the body's flow, which meant that the incrementor had access to local variables declared in the body. Now, incrementors no longer have access to such variables. Fixes AssemblyScript#2825.
CountBleck
added a commit
to CountBleck/assemblyscript
that referenced
this issue
Mar 12, 2024
It turns out that incrementors were compiled with the body's flow, which meant that the incrementor had access to local variables declared in the body. Now, incrementors no longer have access to such variables. Fixes AssemblyScript#2825.
CountBleck
added a commit
to CountBleck/assemblyscript
that referenced
this issue
Mar 12, 2024
It turns out that incrementors were compiled with the body's flow, which meant that the incrementor had access to local variables declared in the body. Now, incrementors no longer have access to such variables. Fixes AssemblyScript#2825.
CountBleck
added a commit
that referenced
this issue
Apr 2, 2024
It turns out that incrementors were compiled with the body's flow, which meant that the incrementor had access to local variables declared in the body. Now, incrementors no longer have access to such variables. Fixes #2825.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug description
The compiler considers "i" to be one variable, not two, and an infinite loop occurs.
Steps to reproduce
run
AssemblyScript version
0.27.15
The text was updated successfully, but these errors were encountered: