Merge pull request #1861 from saper/home-override
[mono-project.git] / mcs / tests / gtest-variance-1.cs
blob036d38fbdef6c6065b70a320689d377eed515982
1 interface IFoo<out T>
3 T Bar { get; }
6 class Foo : IFoo<string>
8 readonly string bar;
9 public Foo (string bar)
11 this.bar = bar;
13 public string Bar { get { return bar; } }
16 public class Test
18 public static int Main ()
20 string bar = "Who is John Galt?";
21 IFoo<string> foo = new Foo(bar);
22 IFoo<object> foo2 = foo;
23 if (!foo2.Bar.Equals (bar))
24 return 1;
26 foo2 = new Foo(bar);
27 if (foo2.Bar != bar)
28 return 2;
30 return 0;