RCS1151: Remove redundant cast
Properties
Property | Value |
---|---|
Default Severity | Hidden |
Minimum language version | - |
Examples
Example #1
diagnostic.cs
var b = new Base();
((Foo)b).Bar();
fix.cs
b.Bar();
Example #2
diagnostic.cs
IEnumerable<string> x = EnumerateStrings().Cast<string>();
fix.cs
IEnumerable<string> x = EnumerateStrings();