1 // Compiler options: -langversion:default
3 // Test for contravariance support in delegates
11 public A (string name
)
13 this.name
= "A::" + name
;
28 public B (string name
)
30 this.name
= "B::" + name
;
41 public C (string name
, string value)
43 this.name
= "C::" + name
;
56 delegate void MethodHandler (C c1
, C c2
, C c3
);
58 static void MethodSample (B b
, A a
, C c
)
60 Console
.WriteLine ("b = {0}", b
.Name
);
61 Console
.WriteLine ("a = {0}", a
.Name
);
62 Console
.WriteLine ("c = {0}, {1}", c
.Name
, c
.Value
);
67 MethodHandler mh
= MethodSample
;
69 C a
= new C ("Hello", "hello");
70 C b
= new C ("World", "world");
71 C c
= new C ("!", "!!!");