Skip to main content

RCS1244: Simplify 'default' expression

Properties

PropertyValue
Default SeverityHidden
Minimum language version7.1

Summary

This analyzer is similar to IDE0034 but there are some differences. For example this analyzer does not simplify 'default' expression passed as an argument expression.

Examples

Example #1

diagnostic.cs
Foo M(Foo foo = default(Foo))
{
return default(Foo);
}
fix.cs
Foo M(Foo foo = default)
{
return default;
}

Applies to