File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
csharp/ql/test/library-tests/implicittostring Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ public override string ToString()
1010 }
1111 }
1212
13+ public class Container2 : Container { }
14+
15+ public class Container3 { }
16+
1317 public class FormattableContainer : IFormattable
1418 {
1519 public string ToString ( string format , IFormatProvider formatProvider )
@@ -40,5 +44,11 @@ public void M()
4044 y = "Hello" + formattableContainer ; // Implicit call to ToString().
4145 y = $ "Hello { formattableContainer } "; // Implicit call to ToString(string, IFormatProvider). We don't handle this.
4246 y = $ "Hello { formattableContainer : D} "; // Implicit call to ToString(string, IFormatProvider). We don't handle this.
47+
48+ var container2 = new Container2 ( ) ;
49+ y = "Hello" + container2 ; // Implicit Container.ToString call.
50+
51+ var container3 = new Container3 ( ) ;
52+ y = "Hello" + container3 ; // Implicit Object.ToString call.
4353 }
4454}
Original file line number Diff line number Diff line change 1- | implicitToString.cs:31 :27:31 :35 | call to method ToString |
2- | implicitToString.cs:33 :22:33 :30 | call to method ToString |
3- | implicitToString.cs:35 :22:35 :30 | call to method ToString |
4- | implicitToString.cs:40 :23:40 :42 | call to method ToString |
1+ | implicitToString.cs:35 :27:35 :35 | call to method ToString |
2+ | implicitToString.cs:37 :22:37 :30 | call to method ToString |
3+ | implicitToString.cs:39 :22:39 :30 | call to method ToString |
4+ | implicitToString.cs:44 :23:44 :42 | call to method ToString |
You can’t perform that action at this time.
0 commit comments