New test.
[mono.git] / mcs / tests / gtest-316.cs
1 // Bug #79984
2 using System;
3
4 class X
5 {
6         static int Main ()
7         {
8                 new Derived ().Method<Foo> ();
9                 return 0;
10         }
11 }
12
13 class Foo
14 {
15         public int X;
16 }
17         
18 abstract class Base
19 {
20         public abstract void Method<R> ()
21                 where R : Foo, new ();
22 }
23         
24 class Derived : Base
25 {
26         public override void Method<S> ()
27         {
28                 Method2<S> ();
29                 // S s = new S ();
30                 // Console.WriteLine (s.X);
31         }
32
33         public void Method2<T> ()
34                 where T : Foo, new ()
35         {
36                 T t = new T ();
37                 Console.WriteLine (t.X);
38         }
39 }