Closed
Description
Type of issue
Code doesn't work
Description
The implicit index access example seemed not working
int[] numbers =
{
[^1] = 4,
[^2] = 3,
[^3] = 2,
[^4] = 1,
};
CS0131: The left-hand side of an assignment must be a variable, property or indexer
And I'm using the latest vs preview and targeted net9.0
with .NET 9 RC1 SDK installed
Page URL
https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-13#implicit-index-access
Content source URL
https://github.com/dotnet/docs/blob/main/docs/csharp/whats-new/csharp-13.md
Document Version Independent Id
587ed47f-f532-e018-9b0d-6ee76afd20e4
Article author
Metadata
- ID: c36588d0-6bdf-1740-220c-10b20bb88730
- Service: dotnet-csharp
- Sub-service: whats-new