do not check order sequence if option /order was not used
[mono.git] / mcs / tests / gtest-variance-1.cs
1 interface IFoo<out T>
2 {
3         T Bar { get; }
4 }
5
6 class Foo : IFoo<string>
7 {
8         readonly string bar;
9         public Foo (string bar)
10         {
11                 this.bar = bar;
12         }
13         public string Bar { get { return bar; } }
14 }
15
16 public class Test
17 {
18         static int Main ()
19         {
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;
25
26                 foo2 = new Foo(bar);
27                 if (foo2.Bar != bar)
28                         return 2;
29
30                 return 0;
31         }
32 }