OpenRoberta / openroberta-lab

The programming environment »Open Roberta Lab« by Fraunhofer IAIS enables children and adolescents to program robots. A variety of different programming blocks are provided to program motors and sensors of the robot. Open Roberta Lab uses an approach of graphical programming so that beginners can seamlessly start coding. As a cloud-based application, the platform can be used without prior installation of specific software but runs in any popular browser, independent of operating system and device.
Apache License 2.0
123 stars 118 forks source link

Refactor Null Constant Usage in Blockly Logic Blocks and Test #1673

Open alvaro555 opened 2 months ago

alvaro555 commented 2 months ago

Describe the bug The null constant was previously used inappropriately in the Integration test, specifically in listOperationsBasic the block "in list X find first occurrence of item Y" (IndexOfFunct) . Although this specific issue has been resolved, there is a need to move the null constant from logic blocks and change its color to pink to correctly represent connection types. Additionally, the null constant should be removed from any tests that do not involve connection types or are used incorrectly.

Additional context This issue was discovered because of the TypecheckCommonLanguageVisitor, which currently works with microbitv2, ev3, and WeDo.

bjost2s commented 2 months ago

The null constant is more widely usable, here are the definitions of possible types (from blockly, not only "connection"): "output": ["Connection", "String", "Array_Boolean", "Array_Colour", "Array_Connection", "Array_Number", "Array_String"],

and here is a full list of toolboxes using it: image @alvaro555, let's discuss the next steps together

rbudde commented 2 months ago

btw: null is used inconsistently in blockly. You may create an array with null, but you cant update the array with null. The block which refers to the lists name ("l") jumps out of the set block. Assigning a string does work. null-error