TypeName

CodeMustNotContainSpaceAfterNewKeywordInImplicitlyTypedArrayAllocation

CheckId

SA1026

Category

Spacing Rules

Cause

An implicitly typed new array allocation within a C# code file is not spaced correctly.

Rule Description

A violation of this rule occurs whenever the code contains an implicitly typed new array allocation which is not spaced correctly. Within an implicitly typed new array allocation, there should not be any space between the new keyword and the opening array bracket. For example:

    var a = new[] { 1, 10, 100, 1000 };

How to Fix Violations

To fix a violation of this rule, remove any whitespace between the new keyword and the opening array bracket.