Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gtest-597.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cbf9e7345e2ae50e5f8e9de97a6b73571401f6b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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>
	{
	}
}