2010-04-13 Sebastien Pouliot <sebastien@ximian.com>
[mono-project.git] / mcs / tests / gtest-variance-8.cs
blob10a097ac534e93e56de18204377b1aec0ba5da89
1 // Compiler options: -langversion:future
3 using System;
5 interface IIn<in T>
9 interface IOut<out T>
13 class A<T> : IIn<T>, IOut<T>
17 class C
19 public static int Main ()
21 IIn<string> a_string = new A<string> ();
22 IIn<object> a_object = new A<object> ();
24 if (!(a_string is IIn<string>))
25 return 1;
27 if ((a_string is IIn<object>))
28 return 2;
30 if (!(a_object is IIn<string>))
31 return 3;
33 if (!(a_object is IIn<object>))
34 return 4;
36 IOut<string> b_string = new A<string> ();
37 IOut<object> b_object = new A<object> ();
39 if (!(b_string is IOut<string>))
40 return 10;
42 if (!(b_string is IOut<object>))
43 return 11;
45 if (b_object is IOut<string>)
46 return 12;
48 if (!(b_object is IOut<object>))
49 return 13;
51 Console.WriteLine ("OK");
52 return 0;