microsoft / microsoft/pxt-microbit

Program does not convert to Python - "Switch statement not implemented"

Open
#2,954 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P2 python
Dominant language
TypeScript
Stars
804
Forks
721
Avg merge
2d 9h
Merged PRs (30d)
2

Description

https://makecode.microbit.org/_79tYCx3ycWHy

Also notice the weird state where it's still showing JS but now the whole program is one error:
2020-05-01 11 17 26

in console:

error: main.ts(NaN,NaN): error TS3002: Not implemented: SwitchStatement (221)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the linked MakeCode program and reproduce the JavaScript-to-Python conversion failure. Start by tracing the compiler path that reports SwitchStatement as not implemented, then verify that the program converts successfully and that the editor no longer collapses into one error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.