mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
C#: Add a RedundantToStringCall test case.
This commit is contained in:
@@ -9,5 +9,8 @@ class RedundantToString
|
||||
|
||||
Console.WriteLine($"Hello: {o.ToString()}"); // BAD
|
||||
Console.WriteLine($"Hello: {o}"); // GOOD
|
||||
|
||||
Console.WriteLine("Hello: " + o.ToString()); // BAD
|
||||
Console.WriteLine("Hello: " + o); // GOOD
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
| RedundantToStringCall.cs:7:27:7:38 | call to method ToString | Redundant call to 'ToString' on a String object. |
|
||||
| RedundantToStringCall.cs:10:37:10:48 | call to method ToString | Redundant call to 'ToString' on a String object. |
|
||||
| RedundantToStringCall.cs:13:39:13:50 | call to method ToString | Redundant call to 'ToString' on a String object. |
|
||||
| RedundantToStringCallBad.cs:7:45:7:56 | call to method ToString | Redundant call to 'ToString' on a String object. |
|
||||
|
||||
Reference in New Issue
Block a user