microsoft / pxt-arcade

Arcade game editor based on Microsoft MakeCode
https://arcade.makecode.com
MIT License
473 stars 200 forks source link

Using variables_get shadow in extensions forces value to be "item" instead of user-defined with any[] parameter #6414

Open sargedev opened 1 month ago

sargedev commented 1 month ago

Describe the bug When setting a default value for the variables_get shadow for a parameter of type any[], the variable name is set to item instead of the default value set by the user. This syntax works for other datatypes

To Reproduce Steps to reproduce the behavior:

  1. Create a project with and link it to a GitHub repository
  2. Add the following code:

    //% block="test"
    namespace test {
    //% block="test $array"
    //% array.shadow=variables_get
    //% array.defl=list
    export function test(array: any[]) {
    
    }
    }
  3. Test the extension
  4. The block present in the test drawer is "test [item]"

Expected behavior The parameter in the block drawer is supposed to be named list.

Screenshots image image

Desktop (please complete the following information):