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

40 lines
474 B
C#

// Bug #79984
using System;
class X
{
public static int Main ()
{
new Derived ().Method<Foo> ();
return 0;
}
}
class Foo
{
public int X;
}
abstract class Base
{
public abstract void Method<R> ()
where R : Foo, new ();
}
class Derived : Base
{
public override void Method<S> ()
{
Method2<S> ();
// S s = new S ();
// Console.WriteLine (s.X);
}
public void Method2<T> ()
where T : Foo, new ()
{
T t = new T ();
Console.WriteLine (t.X);
}
}