blob: 8b82e33110b05447f856142bfa4e5e9e4a165b25 (
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
|
using System;
using System.Runtime.CompilerServices;
interface IFoo
{
[IndexerName ("Bar")]
int this[int i] { get; }
}
class Foo : IFoo
{
public int this[int i] { get { return 42; } }
}
abstract class Bar
{
[IndexerName ("Baz")]
public abstract int this[int i] { get; }
}
class Babar : Bar
{
public override int this[int i] { get { return 42; } }
}
class Test
{
public static int Main ()
{
if (typeof (Foo).GetProperty ("Bar") != null)
return 1;
if (typeof (Babar).GetProperty ("Baz") == null)
return 2;
return 0;
}
}
|