Initial set of Ward sgen annotations (#5705)
[mono.git] / mcs / tests / gtest-variance-8.cs
1 using System;
2
3 interface IIn<in T>
4 {
5 }
6
7 interface IOut<out T>
8 {
9 }
10
11 class A<T> : IIn<T>, IOut<T>
12 {
13 }
14
15 class C
16 {
17         public static int Main ()
18         {
19                 IIn<string> a_string = new A<string> ();
20                 IIn<object> a_object = new A<object> ();
21
22                 if (!(a_string is IIn<string>))
23                         return 1;
24                 
25                 if ((a_string is IIn<object>))
26                         return 2;
27                 
28                 if (!(a_object is IIn<string>))
29                         return 3;
30                 
31                 if (!(a_object is IIn<object>))
32                         return 4;
33
34                 IOut<string> b_string = new A<string> ();
35                 IOut<object> b_object = new A<object> ();
36
37                 if (!(b_string is IOut<string>))
38                         return 10;
39                 
40                 if (!(b_string is IOut<object>))
41                         return 11;
42                 
43                 if (b_object is IOut<string>)
44                         return 12;
45                 
46                 if (!(b_object is IOut<object>))
47                         return 13;
48                 
49                 Console.WriteLine ("OK");
50                 return 0;
51         }
52 }