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

Copy Pasting Code Repeatedly Causes Local Var Count To Increment #696

Open
SolventMercury opened this issue Nov 20, 2021 · 2 comments
Open

Comments

@SolventMercury
Copy link
Contributor

I've discovered that alternately copy-pasting and deleting this snippet of code:

var hello = 13
draw_text(0, 0, string(hello))

As the sole code of a draw event, results in the line

.localvar 3 hello X

Incrementing the value of X by 1 each time you do so.

Demonstration.mp4
@SolventMercury SolventMercury changed the title Compile Error - Copy Pasting Code Repeatedly Causes Local Var Thing To Increment Copy Pasting Code Repeatedly Causes Local Var Thing To Increment Nov 20, 2021
@SolventMercury SolventMercury changed the title Copy Pasting Code Repeatedly Causes Local Var Thing To Increment Copy Pasting Code Repeatedly Causes Local Count Thing To Increment Nov 20, 2021
@SolventMercury SolventMercury changed the title Copy Pasting Code Repeatedly Causes Local Count Thing To Increment Copy Pasting Code Repeatedly Causes Local Var Count To Increment Nov 20, 2021
@Miepee
Copy link
Contributor

Miepee commented Mar 20, 2022

Probably already known, but the cause for this is that every time var hello is written, a new code local hello gets created. When that code gets removed, UTMT doesn't check if hello is still in use / if it can be removed from the code locals list.

While it would be neat if UTMT could check that, it'd probably lead to weird behaviour. What if someone wanted to have a code local that isn't referenced by anything?

@colinator27
Copy link
Member

I believe this should be resolved by #2056, if it wasn't already.

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