Merge pull request #4419 from BrzVlad/fix-oom-nre
[mono.git] / mcs / tests / test-773.cs
1 using System;
2 using System.Runtime.CompilerServices;
3
4 interface IFoo
5 {
6         [IndexerName ("Bar")]
7         int this[int i] { get; }
8 }
9
10 class Foo : IFoo
11 {
12         public int this[int i] { get { return 42; } }
13 }
14
15 abstract class Bar
16 {
17         [IndexerName ("Baz")]
18         public abstract int this[int i] { get; }
19 }
20
21 class Babar : Bar
22 {
23         public override int this[int i] { get { return 42; } }
24 }
25
26 class Test
27 {
28         public static int Main ()
29         {
30                 if (typeof (Foo).GetProperty ("Bar") != null)
31                         return 1;
32
33                 if (typeof (Babar).GetProperty ("Baz") == null)
34                         return 2;
35
36                 return 0;
37         }
38 }