Skip to content

Champion: Stackalloc array initializers (15.7) #1286

@jcouv

Description

@jcouv

In addition to the currently allowed syntax (stackalloc int[3]) we should allow stack allocated arrays be created with initialization:

stackalloc int[3] { 1, 2, 3 }
stackalloc int[] { 1, 2, 3 }
stackalloc[] { 1, 2, 3 }

Discussed in LDM in Jan 2018 (link to meeting notes TBD)
Prototype dotnet/roslyn#24249

Metadata

Metadata

Assignees

Labels

Implemented Needs ECMA SpecThis feature has been implemented in C#, but still needs to be merged into the ECMA specificationProposal champion

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions