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

47 lines
585 B
C#

public class Z : IGenericInterface<Z>
{
public void Stop ()
{
}
Z IGenericInterface<Z>.Start ()
{
return this;
}
}
public interface IGenericInterface<T>
{
T Start ();
}
public class A<Y, Y2, W>
where Y : Z, IGenericInterface<Y>
where Y2 : class
where W : Y, Y2
{
public void SomeOperation (W w)
{
w.Start ();
w.Stop ();
}
public void SomeOtherOperation (Y y)
{
y.Start ();
y.Stop ();
}
}
public class Foo
{
public static int Main ()
{
var a = new A<Z, object, Z> ();
a.SomeOperation (new Z ());
a.SomeOtherOperation (new Z ());
return 0;
}
}