pybricks / support

Pybricks support and general discussion

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Local loop variable nested in multitask not generated correctly

laurensvalk opened this issue · comments

Describe the bug
Nested local variables do not work correctly.

To reproduce
image

Expected behavior
count is a local loop variable, so it shouldn't be passed to the subtask.

Related to #1590

It should as arguments only the variables from outside of the subtask.

Simpler example:
image

So the logic should be: A variable should be passed in only if the variable definition block is not a descendant of the local stack top block.

Fixed:

image