a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
38 lines
545 B
C#
38 lines
545 B
C#
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;
|
|
}
|
|
} |