mirror of
https://github.com/github/codeql.git
synced 2025-12-22 19:56:32 +01:00
QL code and tests for C#/C++/JavaScript.
This commit is contained in:
25
csharp/ql/src/Useless code/DefaultToStringGood.cs
Normal file
25
csharp/ql/src/Useless code/DefaultToStringGood.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
class Good
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var p = new Person("Eric Arthur Blair");
|
||||
Console.WriteLine("p: " + p);
|
||||
|
||||
var ints = new int[] { 1, 2, 3 };
|
||||
Console.WriteLine("ints: " + string.Join(", ", ints));
|
||||
}
|
||||
|
||||
class Person
|
||||
{
|
||||
private string Name;
|
||||
|
||||
public Person(string name)
|
||||
{
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
public override string ToString() => Name;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user