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

Weridness when using += or ++ with uninitialized variables #2319

Open
Regnsloja opened this issue Oct 23, 2022 · 0 comments
Open

Weridness when using += or ++ with uninitialized variables #2319

Regnsloja opened this issue Oct 23, 2022 · 0 comments

Comments

@Regnsloja
Copy link

When dealing with a previously uninitialized variables, the follow does not work properly:

variable += 1

This also does not work properly:

variable++

But the following does work:

variable = variable + 1

And this also works:

variable = 0 (somewhere during a creation step, not here right before the incrementing as that would "work" but lock it at 1 obviously)
variable += 1

Why or how I don't know, I was just trying to get someone elses simple old project to work properly and this change got a lot of stuff working in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant