In class/Microsoft.Build.Tasks/Microsoft.Build.Tasks:
[mcs.git] / tests / gtest-variance-2.cs
blob531a8b8ae5d3e3101792669d854fe19f0074d8c5
1 // Compiler options: -langversion:future
3 interface IFoo<in T>
5 string Bar (T t);
8 class Foo : IFoo<object>
10 public string Bar (object t)
12 return t.GetType ().FullName;
16 public class Test
18 static int Main ()
20 IFoo<object> foo = new Foo ();
21 IFoo<string> foo2 = foo;
23 if (foo2.Bar ("blah") != typeof (string).FullName)
24 return 1;
26 foo2 = new Foo();
27 if (foo2.Bar ("blah") != typeof (string).FullName)
28 return 2;
31 return 0;