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

gtest-057.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 603d348bc4f54f7610841a9e9611824ba5e2eeb1 (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
using System;

interface IHello<T>
{
	void Print (T t);
}

interface Foo
{
	IHello<U> Test<U> ();
}

class Hello<T> : IHello<T>, Foo
{
	public void Print (T t)
	{
		Console.WriteLine ("Hello: {0}", t);
	}

	public IHello<U> Test<U> ()
	{
		return new Hello<U> ();
	}
}

class X
{
	public static void Main ()
	{
		Hello<int> hello = new Hello<int> ();
		hello.Print (5);
		hello.Test<float> ().Print (3.14F);

		IHello<string> foo = hello.Test<string> ();
		foo.Print ("World");
	}
}