linux-packaging-mono/mcs/tests/gtest-variance-6.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

31 lines
895 B
C#

interface ICovariant<out T> { }
interface IContravariant<in T> { }
delegate ICovariant<U> Cov1<out U> (IContravariant<U> x);
delegate ICovariant<U> Cov2<out U> (IContravariant<ICovariant<U>> x);
delegate ICovariant<IContravariant<IContravariant<U>>> Cov3<out U> (IContravariant<IContravariant<IContravariant<ICovariant<U>>>> x);
delegate ICovariant<int> Cov4<out U> ();
delegate IContravariant<int> Cov5<out U> ();
delegate IContravariant<U[]> Contra5<in U> (U u, ICovariant<U> x);
delegate IContravariant<U[]> Contra6<in U> ();
delegate IContravariant<U> Contra7<in U> (U u, ICovariant<U> x);
delegate IContravariant<ICovariant<U>> Contra8<in U> (U u, ICovariant<U> x);
interface ITest_1<out T>
{
ICovariant<T> CovariantHandler (IContravariant<T> x);
}
interface ITest_2<in T>
{
IContravariant<T> CovariantHandler (ICovariant<T> x);
}
class Program
{
public static void Main ()
{
}
}