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()
10
10
}
11
11
}
12
12
13
+ public class Container2 : Container { }
14
+
15
+ public class Container3 { }
16
+
13
17
public class FormattableContainer : IFormattable
14
18
{
15
19
public string ToString ( string format , IFormatProvider formatProvider )
@@ -40,5 +44,11 @@ public void M()
40
44
y = "Hello" + formattableContainer ; // Implicit call to ToString().
41
45
y = $ "Hello { formattableContainer } "; // Implicit call to ToString(string, IFormatProvider). We don't handle this.
42
46
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.
43
53
}
44
54
}
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