Variable is declared wrong type in emitted code #582
Labels
bug
Something isn't working
needs discussion
Issue that requires further refinement before any code changes
In the example project below, the objective is to cause the terminal to emit a beep sound five times. In testing this project, the terminalBell variable is assigned a character value of decimal 7, the ASCII bell character. The compiler issues a warning about not casting an int value but we're not using a int value here. Except that we actually are.
The code emitted from this project creates the terminalBell variable as an integer, even though the intent was for it to represent a character.
If the first block is disabled and the second block is enabled, the project is now explicitly declaring the terminalBell variable as a character array and the ASCII bell character is being explicitly converted to a character.
It seems that the variable declaration should be based on how it is used but that is not happening here.
PlayBeep.svg.zip
The text was updated successfully, but these errors were encountered: