Merge pull request #3294 from lambdageek/dev/fix-42625
[mono.git] / mono / tests / verifier / valid_mvar_is_transitive_compatibility.cs
1 using System;
2 using System.Reflection;
3 using System.Collections.Generic;
4
5
6 class Test
7 {
8     static U[] Foo<T, U> (T[] arg) where T : class, U
9     {
10         return arg;
11     }
12
13     public static IEnumerable<U> Foo2<T, U> (IEnumerable<T> arg) where T : class, U
14     {
15         return arg;
16     }
17
18     static IEnumerable<U[]> Foo3<T, U> (IEnumerable<T[]> arg) where T : class, U
19     {
20         return arg;
21     }
22
23     static int Main ()
24     {
25                 var m = typeof (Test).GetMethod ("Foo2");
26                 var gp = m.GetGenericArguments ();
27                 var t = gp[0];
28                 var u = gp[1];
29                 Console.WriteLine (t);
30                 Console.WriteLine (u);
31                 Console.WriteLine (t.IsAssignableFrom (u));
32                 Console.WriteLine (u.IsAssignableFrom (t));
33         return 0;
34     }
35 }