File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
csharp/ql/test/query-tests/Useless Code/RedundantToStringCall Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -9,5 +9,8 @@ public void M(object o)
99
1010 Console . WriteLine ( $ "Hello: { o . ToString ( ) } ") ; // BAD
1111 Console . WriteLine ( $ "Hello: { o } ") ; // GOOD
12+
13+ Console . WriteLine ( "Hello: " + o . ToString ( ) ) ; // BAD
14+ Console . WriteLine ( "Hello: " + o ) ; // GOOD
1215 }
1316}
Original file line number Diff line number Diff line change 11| RedundantToStringCall.cs:7:27:7:38 | call to method ToString | Redundant call to 'ToString' on a String object. |
22| RedundantToStringCall.cs:10:37:10:48 | call to method ToString | Redundant call to 'ToString' on a String object. |
3+ | RedundantToStringCall.cs:13:39:13:50 | call to method ToString | Redundant call to 'ToString' on a String object. |
34| RedundantToStringCallBad.cs:7:45:7:56 | call to method ToString | Redundant call to 'ToString' on a String object. |
You can’t perform that action at this time.
0 commit comments