Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

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;
}
}