a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
24 lines
255 B
C#
24 lines
255 B
C#
public class Z { }
|
|
|
|
public class A<X, Y>
|
|
where Y : Z
|
|
where X : Y
|
|
{
|
|
public X Foo (Y y)
|
|
{
|
|
return y as X;
|
|
}
|
|
}
|
|
|
|
public class Foo
|
|
{
|
|
public static int Main ()
|
|
{
|
|
var a = new A<Z, Z> ();
|
|
if (a.Foo (new Z ()) == null)
|
|
return 1;
|
|
|
|
return 0;
|
|
}
|
|
}
|