Navigation:  StyleCop 4.3 > StyleCop 4.3 Rules > Spacing Rules >

SA1026: CodeMustNotContainSpaceAfterNewKeywordInImplicitlyTypedArrayAllocation

Previous pageReturn to chapter overviewNext page
StyleCop 4.3

Send comments on this topic.

SA1026: CodeMustNotContainSpaceAfterNewKeywordInImplicitlyTypedArrayAllocation
Glossary Item Box
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.

 


© Microsoft Corporation. All Rights Reserved.