Open microbit-mark opened 3 years ago
Describe the bug This program works in the simulator, but does not compile. https://makecode.microbit.org/_1CJeg23D0bYX
Switching to JS sometimes results in an error message on line 1
You can workaround this eg by using the count variable instead of num, but I would still expect num to work
count
num
You can also set a new variable for the result od the calculation
Minimal repro:
function square (num: number) { return num * num } let count = 0 square(count)
The issue seems to be in the return statement; the + and - operators work fine, most others fail.
Describe the bug This program works in the simulator, but does not compile.
https://makecode.microbit.org/_1CJeg23D0bYX
Switching to JS sometimes results in an error message on line 1![image](https://user-images.githubusercontent.com/31242877/125759271-fca9997a-d861-4a2c-b0ac-537d334d1c0b.png)
You can workaround this eg by using the
count
variable instead ofnum
, but I would still expectnum
to workYou can also set a new variable for the result od the calculation