Skip to content

bug: variables renamed and local variables appearing on other sprites. #601

Description

@Joeclinton1

This bug is widespread, data loss causing and, in some cases (see below), project breaking.


Imagine waking up to a comment telling you your project is is broken, but you never made any changes to it ... it just spontaneously broke. Well that's what happened to me today. What was weirder was that every remix of the project was broken too. In fact every project on scratch using my code block was broken.

It took me a couple hours but I found the bug: i was iterating over i2, but within the loop using i. This was strange I thought, because it was fine before. Since it was also renamed across all the other projects the only conclusion is Scratch had renamed it not me.

Image

The same bug was apparent across all the broken projects. They had all had i2 renamed to i. In fact in other locations where I had used j2 were renamed.

Image

I believe the bug is to do with local variables appearing in sprites they aren't meant to appear in, triggering a rename. I am unsure at this point. I believe project breaking effects only occur if you use foreach, as the renamed variables still function as independent variables, but foreach works via the variable name not id.

the renaming does not affect turbowarp so it is probably a spork bug.

See one of the remixes of my project (bsp sprite, traversal function) for an example of the renaming: https://scratch.mit.edu/projects/1033253555/
See this one in the render sprite for the local/global variable bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions