1 // Compiler options: -langversion:future
3 interface ICovariant
<out T
> { }
4 interface IContravariant
<in T
> { }
6 delegate ICovariant
<U
> Cov1
<out U
> (IContravariant
<U
> x
);
7 delegate ICovariant
<U
> Cov2
<out U
> (IContravariant
<ICovariant
<U
>> x
);
8 delegate ICovariant
<IContravariant
<IContravariant
<U
>>> Cov3
<out U
> (IContravariant
<IContravariant
<IContravariant
<ICovariant
<U
>>>> x
);
9 delegate ICovariant
<int> Cov4
<out U
> ();
10 delegate IContravariant
<int> Cov5
<out U
> ();
12 delegate IContravariant
<U
[]> Contra5
<in U
> (U u
, ICovariant
<U
> x
);
13 delegate IContravariant
<U
[]> Contra6
<in U
> ();
14 delegate IContravariant
<U
> Contra7
<in U
> (U u
, ICovariant
<U
> x
);
15 delegate IContravariant
<ICovariant
<U
>> Contra8
<in U
> (U u
, ICovariant
<U
> x
);
17 interface ITest_1
<out T
>
19 ICovariant
<T
> CovariantHandler (IContravariant
<T
> x
);
22 interface ITest_2
<in T
>
24 IContravariant
<T
> CovariantHandler (ICovariant
<T
> x
);