a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
38 lines
347 B
C#
38 lines
347 B
C#
interface ITest
|
|
{
|
|
void Test ();
|
|
}
|
|
|
|
class Tester<T> where T : ITest, new ()
|
|
{
|
|
public void Do ()
|
|
{
|
|
new T ().Test ();
|
|
}
|
|
}
|
|
|
|
class Reference : ITest
|
|
{
|
|
public void Test ()
|
|
{
|
|
}
|
|
}
|
|
|
|
struct Value : ITest
|
|
{
|
|
public void Test ()
|
|
{
|
|
}
|
|
}
|
|
|
|
class C
|
|
{
|
|
public static void Main ()
|
|
{
|
|
new Tester<Reference> ().Do ();
|
|
new Tester<Value> ().Do ();
|
|
}
|
|
}
|
|
|
|
|