Skip to main content

RCS1009: Use explicit type instead of 'var' (foreach variable)

WARNING

This analyzer is obsolete. Use RCS1264 instead.

Properties

PropertyValue
Default Severitydisabled by default
Minimum language version-

Examples

Example #1

diagnostic.cs
var items = new List<string>();

// ...

foreach (var item in items)
{
}
fix.cs
foreach (string item in items)
{
}

Applies to