Skip to content

Conversation

@thaystg
Copy link
Member

@thaystg thaystg commented Jul 27, 2022

It was already working:

array[i]
array[i][j]

In this PR I'm implementing support to:
array[i,j]

Blazor Sample:

    private int currentCount = 0;
    int[][] jaggedArray = new int[][]
        {
            new int[] { 1, 3, 5, 7, 9 },
            new int[] { 0, 2, 4, 6 },
            new int[] { 11, 22 }
        };

    int[] array1D = new int[] { 1, 2, 3, 4, 5, 6 };
    int[,] array2D = new int[,] { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } };
    int[,] array2Da = new int[4, 2] { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } };
    string[,] array2Db = new string[3, 2] { { "one", "two" }, { "three", "four" },
                                        { "five", "six" } };

    int[,,] array3D = new int[,,] { { { 1, 2, 3 }, { 4, 5, 6 } },
                                 { { 7, 8, 9 }, { 10, 11, 12 } } };
    int[,,] array3Da = new int[2, 2, 3] { { { 1, 2, 3 }, { 4, 5, 6 } },
                                       { { 7, 8, 9 }, { 10, 11, 12 } } };

    private void IncrementCount()
    {
        currentCount++;
    }

image

Fixes #56021

@thaystg thaystg requested review from ilonatommy and lewing July 27, 2022 21:20
@thaystg thaystg requested a review from radical as a code owner July 27, 2022 21:20
@ghost ghost added the area-Debugger-mono label Jul 27, 2022
@ghost ghost assigned thaystg Jul 27, 2022
@ghost
Copy link

ghost commented Jul 27, 2022

Tagging subscribers to this area: @thaystg
See info in area-owners.md if you want to be subscribed.

Issue Details

It was already working:

array[i]
array[i][j]

In this PR I'm implementing support to:
array[i,j]

Blazor Sample:

    private int currentCount = 0;
    int[][] jaggedArray = new int[][]
        {
            new int[] { 1, 3, 5, 7, 9 },
            new int[] { 0, 2, 4, 6 },
            new int[] { 11, 22 }
        };

    int[] array1D = new int[] { 1, 2, 3, 4, 5, 6 };
    int[,] array2D = new int[,] { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } };
    int[,] array2Da = new int[4, 2] { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } };
    string[,] array2Db = new string[3, 2] { { "one", "two" }, { "three", "four" },
                                        { "five", "six" } };

    int[,,] array3D = new int[,,] { { { 1, 2, 3 }, { 4, 5, 6 } },
                                 { { 7, 8, 9 }, { 10, 11, 12 } } };
    int[,,] array3Da = new int[2, 2, 3] { { { 1, 2, 3 }, { 4, 5, 6 } },
                                       { { 7, 8, 9 }, { 10, 11, 12 } } };

    private void IncrementCount()
    {
        currentCount++;
    }

image

Fixes #56021

Author: thaystg
Assignees: -
Labels:

area-Debugger-mono

Milestone: -

Copy link
Member

@ilonatommy ilonatommy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works in VS both in watch and immediate window. Browser's watch if fine as well:
image

@thaystg thaystg merged commit d641668 into dotnet:main Jul 28, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[wasm] Cannot use array indexing expressions with VS immediate window

2 participants