microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
726 stars 638 forks source link

Array isn't getting inferred in python #3745

Open livcheerful opened 4 years ago

livcheerful commented 4 years ago

Describe the bug This is a user reported bug from Twitter - https://twitter.com/JudianneTeach/status/1328887954333261825

The script is trying to remove an item from an array. After fixing an initial syntax error, we still can't pop an item out of the array.

To Reproduce Steps to reproduce the behavior:

  1. Open this script: https://makecode.microbit.org/_7rgXkF8yD0Kj
  2. There's an error - can't find function "letter_bag.pop", even though pop is a supported array function

image image

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

Desktop (please complete the following information):

PilotFlying commented 3 years ago

A similar one: https://makecode.microbit.org/_EU25jxW2dR0V

(Win10, Chrome)

darzu commented 3 years ago

Likely same underlying issue as: https://github.com/microsoft/pxt-microbit/issues/3579

darzu commented 3 years ago

@abchatra , this is one that likely requires enhanced generics support in py2ts. See my additional thoughts in #3579.