Skip to content
Christophe HEISER edited this page Sep 26, 2015 · 2 revisions
<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

DoNotSplitNullConditionalOperators

CheckId

SA1029

Category

Spacing Rules

Cause

The null conditional symbol is separated by a character.

```csharp // Allowed foo?.Bar();

// Not allowed foo? .Bar();

// Not allowed foo? // comment .Bar();

// Allowed foo?[index];

// Not allowed foo? [index];

// Not allowed foo? // comment [index];

<H2>Rule Description</H2>
<P>A violation of this rule occurs whenever the null conditional symbol ('?.' or '?[')  is separated by a new row, space or comment.</P>
<H2>How to Fix Violations</H2>
<P>To fix a violation of this rule, remove all characters between the null conditional symbol.</P>
<h2>How to Suppress Violations</h2>
<pre>[SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1029:DoNotSplitNullConditionalOperators", Justification = "Reviewed.")]</pre>
</div></div>
</body>
</html>
Clone this wiki locally