Permalink
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (29 sloc) 1013 Bytes

SA1203

TypeName SA1203ConstantsMustAppearBeforeFields
CheckId SA1203
Category Ordering Rules

Cause

A constant field is placed beneath a non-constant field.

Rule description

A violation of this rule occurs when a constant field is placed beneath a non-constant field. Constants should be placed above fields to indicate that the two are fundamentally different types of elements with different considerations for the compiler, different naming requirements, etc.

How to fix violations

To fix an instance of this violation, place all constants above all fields.

How to suppress violations

[SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1203:ConstantsMustAppearBeforeFields", Justification = "Reviewed.")]
#pragma warning disable SA1203 // ConstantsMustAppearBeforeFields
#pragma warning restore SA1203 // ConstantsMustAppearBeforeFields