fix: Fix bug that could caused variable map to be left in an inconsistent state. by gonfunko · Pull Request #9339 · RaspberryPiFoundation/blockly
The basics
The details
Resolves
Fixes #9337
Proposed Changes
This PR cleans up the entry in the underlying variable map when changing the type of a variable such that no variables with its original type exist. Before, a record for the type would remain, mapped to an empty array. Now, the type will be removed entirely in this situation. I also added a test to exercise this behavior. Thanks to @michaelnixonau for reporting this issue and providing a fix in their report.