Merge pull request #4998 from kumpera/fix_56684
[mono.git] / mcs / tests / gtest-589.cs
1 using System;
2
3 public class Z : IGenericInterface<Z>
4 {
5         public Z Start ()
6         {
7                 return this;
8         }
9
10         Z IGenericInterface<Z>.Start ()
11         {
12                 throw new ApplicationException ();
13         }
14 }
15
16 public interface IGenericInterface<T>
17 {
18         T Start ();
19 }
20
21 public class A<T> where T : Z, IGenericInterface<int> 
22 {
23         public void SomeOperation (T t)
24         {
25                 t.Start ();
26         }
27 }
28
29 public class C : Z, IGenericInterface<int> 
30 {
31         int IGenericInterface<int>.Start ()
32         {
33                 throw new NotImplementedException ();
34         }
35
36         public static void Main ()
37         {
38                 new A<C> ().SomeOperation (new C ());
39         }
40 }