Skip to content

The implicit index access example seemed not working #42674

Closed
@WeihanLi

Description

@WeihanLi

Type of issue

Code doesn't work

Description

The implicit index access example seemed not working

image

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

@BillWagner

Metadata

  • ID: c36588d0-6bdf-1740-220c-10b20bb88730
  • Service: dotnet-csharp
  • Sub-service: whats-new

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions