[runtime] Remove all NACL support. It was unmaintained for a long time. (#4955)
[mono.git] / mono / tests / generic-interface-methods.2.cs
1 using System.Collections.Generic;
2
3 public class ClassA {};
4
5 public interface IGen<T> {
6         Dictionary<T,S> makeDict<S> ();
7 }
8
9 public class Gen<T> : IGen<T> {
10         public Dictionary<T,S> makeDict<S> () {
11                 return new Dictionary <T,S> ();
12         }
13 }
14
15 public class Gen2<T,S> {
16         public Dictionary<T,S> makeDict (IGen<T> igt) {
17                 return igt.makeDict<S> ();
18         }
19 }
20
21 public class main {
22         public static int Main () {
23                 Gen<string> gs = new Gen<string> ();
24                 Gen2<string,object> g2so = new Gen2<string,object> ();
25                 Gen2<string,string> g2ss = new Gen2<string,string> ();
26                 Gen2<string,ClassA> g2sa = new Gen2<string,ClassA> ();
27                 Gen2<string,int> g2si = new Gen2<string,int> ();
28
29                 if (g2so.makeDict (gs).GetType () != typeof (Dictionary<string,object>))
30                         return 1;
31                 if (g2ss.makeDict (gs).GetType () != typeof (Dictionary<string,string>))
32                         return 1;
33                 if (g2sa.makeDict (gs).GetType () != typeof (Dictionary<string,ClassA>))
34                         return 1;
35                 if (g2si.makeDict (gs).GetType () != typeof (Dictionary<string,int>))
36                         return 1;
37
38                 return 0;
39         }
40 }