We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RCS1264]
roslynator_use_var = when_type_is_obvious
StringBuilder
Product and Version Used:
NuGet package v. 4.10.0
Steps to Reproduce:
in .editorconfig:
.editorconfig
Code:
internal class Demo { public static string StringBuilderDemo(List<int> entries) { var sb = new StringBuilder("Entries: ") .Append(entries.Count) .Append('.'); return sb.ToString(); } }
Actual Behavior:
On the var keyword: RCS1264: Use 'var' or explicit type
var
RCS1264
Expected Behavior:
The StringBuilder is a well-known type, and this is not an uncommon pattern in my experience.
Much like Parse(string) methods, StringBuilder's Append methods should be recognized as "obviously" returning StringBuilder.
Parse(string)
Append
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Product and Version Used:
NuGet package v. 4.10.0
Steps to Reproduce:
in
.editorconfig
:Code:
Actual Behavior:
On the
var
keyword:RCS1264
: Use 'var' or explicit typeExpected Behavior:
The StringBuilder is a well-known type, and this is not an uncommon pattern in my experience.
Much like
Parse(string)
methods,StringBuilder
'sAppend
methods should be recognized as "obviously" returningStringBuilder
.The text was updated successfully, but these errors were encountered: