SA1026 - Visual-Stylecop/Visual-StyleCop GitHub Wiki
<title>SA1026: CodeMustNotContainSpaceAfterNewKeywordInImplicitlyTypedArrayAllocation</title>
<script src="script/helpstudio.js" type="text/javascript"></script>
<script src="script/StandardText.js" type="text/jscript"></script>
<script type="text/jscript">WritePageTop(document.title);</script>
TypeName |
CodeMustNotContainSpaceAfterNewKeywordInImplicitlyTypedArrayAllocation |
CheckId |
SA1026 |
Category |
Spacing Rules |
An implicitly typed new array allocation within a C# code file is not spaced correctly.
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 };
To fix a violation of this rule, remove any whitespace between the new keyword and the opening array bracket.
[SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1026:CodeMustNotContainSpaceAfterNewKeywordInImplicitlyTypedArrayAllocation", Justification = "Reviewed.")]