Skip to content

Conversation

@GarboMuffin
Copy link
Member

@GarboMuffin GarboMuffin commented Sep 22, 2025

  • Fix Incorrect type optimizations in loop conditions #276 and add test case
    • Added case for CONTROL_WAIT_UNTIL that clears state before analyzing inputs
  • Fix Wait until block condition is incorrectly optimized (624189434 broken) #277 and add test case
    • revert c16be25
    • fix a bug in TypeState#after where variables that did not exist in other would result in type of undefined which seems wrong. changing that seems to fix the infinite loop
    • also makes a couple more optimizations happen, see changes in tw-procedure-return-recursion.sb3.tw-snapshot
  • Add test cases for some previous bugs
  • Use Object.create(null) instead of {} for the variables map, trying to avoid any weird issues resulting from variables with IDs like "toString"
    • No test case because I couldn't find anything concretely broken. It was still possible to end up with functions in state.variables though. Which seems like it might break something later on.

Need to clear the state before analyzing the condition as the condition
may be re-evaluated after yielding.
This reverts commit c16be25.

Caused #276
If a variable existed in `this` but not in `other`, its resulting type
would be set to undefined. Changing it to use the type from `this`
seems to fix #273.
Avoids any weird issues if variables have strange IDs like "toString"
@GarboMuffin
Copy link
Member Author

@Tacodiva you definitely want to look at this at some point

it's easier to read commit-by-commit instead of the big diff

@GarboMuffin GarboMuffin merged commit d7a5f1c into develop Sep 23, 2025
2 checks passed
@GarboMuffin GarboMuffin deleted the fix-277 branch September 23, 2025 00:48
@GarboMuffin
Copy link
Member Author

if there's a better way to do some of those things, let me know

@Tacodiva
Copy link
Member

This all looks great, good job :3

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

Successfully merging this pull request may close these issues.

Wait until block condition is incorrectly optimized (624189434 broken) Incorrect type optimizations in loop conditions

3 participants