mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
C#: Add some value tuple examples for cs/call-to-object-tostring and update test expected output.
This commit is contained in:
@@ -35,6 +35,16 @@ public class DefaultToString
|
||||
|
||||
IPublic g = null;
|
||||
Console.WriteLine(g); // GOOD
|
||||
|
||||
Console.WriteLine(new ValueTuple<int, int>(1, 2)); // GOOD [FALSE POSITIVE]
|
||||
|
||||
Console.WriteLine((1, 2)); // GOOD [FALSE POSITIVE]
|
||||
|
||||
var t1 = new ValueTuple<int, DefaultToString>(1, new DefaultToString());
|
||||
Console.WriteLine(t1); // BAD
|
||||
|
||||
var t2 = new ValueTuple<A, D>(new A(), new D());
|
||||
Console.WriteLine(t2); // GOOD [FALSE POSITIVE]
|
||||
}
|
||||
|
||||
class A
|
||||
|
||||
Reference in New Issue
Block a user