pxt-microbit icon indicating copy to clipboard operation
pxt-microbit copied to clipboard

If statements that have return statements causing the return statement to clip into the bottom of the if-statement

Open ProjectHSI opened this issue 2 years ago • 2 comments

Describe the bug The return statement clips into the bottom of the if statement when it is inside of the if statement.

To Reproduce Steps to reproduce the behavior:

  1. Create a function.
  2. Put a if statement in that function.
  3. Grab a return statement in that block. This might happen with other ending blocks, although this is not tested.
  4. The return statement now intersects the bottom of the if statement.

Expected behavior The return statement terminates the if statement cleanly. That being there isn't any clipping going on.

Screenshots Screenshot 2023-05-16 095558

micro:bit version (please complete the following information): Not hardware related.

Desktop (please complete the following information):

  • OS: Windows
  • Browser Firefox
  • Version 113.0.1 (64-bit)

Additional context This issue also affects MakeCode Arcade and likely other MakeCode editors.

I'm not entirely sure about the Issues Policy, this is my first issue for a PXT repo so please tell me if I did something wrong, I promise to have read the issues policy entirely and I think this is the right repo for this issue.

ProjectHSI avatar May 16 '23 01:05 ProjectHSI

NOTE: REPLACED BY https://github.com/microsoft/pxt/issues/10013. IF THAT ISSUE IS CLOSED FOR BEING A DUPLICATE, THIS ISSUE SHALL BE RESOLVED HERE, OTHERWISE, THIS ISSUE SHALL REFLECT THE STATUS OF THAT ISSUE.

ProjectHSI avatar May 12 '24 22:05 ProjectHSI

Issue Clarification: Return statement visuals are buggy in general, and don't just occur with if statements.

ProjectHSI avatar May 12 '24 22:05 ProjectHSI

This is fixed in /beta.

abchatra avatar Jul 26 '24 22:07 abchatra