Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

35 lines
368 B
C#

using System;
class G1<T1, T2>
where T1 : B
where T2 : T1
{
public static T2 Test1 (B b)
{
return (T2)b;
}
public static T2 Test2 (A a)
{
return (T2)a;
}
public static T2 Test3 (dynamic a)
{
return (T2)a;
}
}
class B : A
{
}
class A
{
static void Main ()
{
G1<B, B>.Test1 (new B ());
G1<B, B>.Test2 (new B ());
G1<B, B>.Test3 (null);
}
}