diff options
Diffstat (limited to 'mcs/tests/gtest-597.cs')
-rw-r--r-- | mcs/tests/gtest-597.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/mcs/tests/gtest-597.cs b/mcs/tests/gtest-597.cs new file mode 100644 index 0000000000..cbf9e7345e --- /dev/null +++ b/mcs/tests/gtest-597.cs @@ -0,0 +1,44 @@ +using System; + +namespace Test +{ + class MainClass + { + public static int Main () + { + if (!Test_1 (new Derived ())) + return 1; + + if (!Test_2 (new S ())) + return 2; + + return 0; + } + + static bool Test_1<T> (Templated<T> template) + { + return template is Derived; + } + + static bool Test_2<U> (IA<U> arg) + { + return arg is S; + } + } + + public abstract class Templated<T> + { + } + + public class Derived : Templated<Derived> + { + } + + public interface IA<T> + { + } + + public struct S : IA<S> + { + } +} |