Updated with review feedback.
[mono.git] / mcs / tests / gtest-597.cs
1 using System;
2
3 namespace Test
4 {
5         class MainClass
6         {
7                 public static int Main ()
8                 {
9                         if (!Test_1 (new Derived ()))
10                                 return 1;
11
12                         if (!Test_2 (new S ()))
13                                 return 2;
14
15                         return 0;
16                 }
17
18                 static bool Test_1<T> (Templated<T> template)
19                 {
20                         return template is Derived;
21                 }
22
23                 static bool Test_2<U> (IA<U> arg)
24                 {
25                         return arg is S;
26                 }
27         }
28
29         public abstract class Templated<T>
30         {
31         }
32
33         public class Derived : Templated<Derived>
34         {
35         }
36
37         public interface IA<T>
38         {
39         }
40
41         public struct S : IA<S>
42         {
43         }
44 }