Product and Version Used:
NuGet package v. 4.12.4
Steps to Reproduce:
in .editorconfig
roslynator_use_var = when_type_is_obvious
Code:
internal class Demo
{
public static void ReadOnlyCharDemo()
{
ReadOnlySpan<char> span = "";
}
}
Actual Behavior:
On the ReadOnlySpan<char> expression: RCS1264: Use 'var' or explicit type
Expected Behavior:
Applying suggested code fix to the code above generates var span = "" statement which changes span variable type to string. My guess is that variables declarations with assignment that have implicit type conversion should be ignored by this analyzer.