c042cd0c52
Former-commit-id: 4610231f55806d2a05ed69e5ff3faa7336cc1479
25 lines
274 B
C#
25 lines
274 B
C#
public interface IA
|
|
{
|
|
int Foo (int x = 0);
|
|
}
|
|
|
|
public class A : IA
|
|
{
|
|
public int Foo (int x)
|
|
{
|
|
return x;
|
|
}
|
|
|
|
private static int Bar<T> (T x) where T : A, IA
|
|
{
|
|
return x.Foo ();
|
|
}
|
|
|
|
public static int Main ()
|
|
{
|
|
if (Bar (new A ()) != 0)
|
|
return 1;
|
|
|
|
return 0;
|
|
}
|
|
} |