S3L0010: Keyword types¶
int, string, bool — the C# keyword wherever one exists.
| Category | Snail |
| Severity | warning — an error under TreatWarningsAsErrors, which every Snail project builds with |
| Analyzer | Simplification in Snail.Sdk.Analyzers |
| Code fix | Use '<keyword>', Fix All supported |
What it reports¶
A framework type name where a C# keyword exists — Boolean, Byte, SByte, Char, Decimal, Double, Single,
Int16, UInt16, Int32, UInt32, Int64, UInt64, Object, String — written plain (Int32), qualified
(System.String), as the receiver of a member access (String.Concat) or through a using alias of one of them:
Use 'int' rather than 'Int32'. This is IDE0049, which a command-line build does not run, carried as a rule of the SDK.
What it leaves alone¶
var, using directives, attribute arguments and nameof(…).
Why¶
The guidelines ask for the keywords: one spelling of each type across the fleet.
How to fix¶
Write the keyword: string.Concat, int.Parse. The code fix does it; Fix All applies it to a document, project or
solution.
Suppressing it¶
Fix the code rather than silence the rule: the rule is part of the standard every Snail repository keeps. Where one place truly must differ, suppress that place and say why:
[SuppressMessage("Snail", "S3L0010:Keyword types", Justification = "<why this place differs>")]
A NoWarn in a project or props file would hide the rule from every new line too; the
conformance check reports one as migration debt (S3LC0017).