blob: 7ed88aa75a5501b1b4b706fbbdac566979d8d3ec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
using System;
using System.Reflection;
namespace N
{
class Nested
{
public interface I<T>
{
T P { get; }
}
public class C : I<int>
{
int I<int>.P
{
get { return 2; }
}
}
}
class M
{
public static int Main ()
{
int count = 0;
foreach (MethodInfo method in typeof (Nested.C).GetMethods (BindingFlags.Instance | BindingFlags.NonPublic)) {
Console.WriteLine (method.Name);
if (method.Name == "N.Nested.I<int>.get_P")
++count;
}
foreach (PropertyInfo pi in typeof (Nested.C).GetProperties (BindingFlags.Instance | BindingFlags.NonPublic)) {
Console.WriteLine (pi.Name);
if (pi.Name == "N.Nested.I<int>.P")
count += 2;
}
return 3 - count;
}
}
}
|