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

gtest-024.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a8b6e7f4779edcc0bbd0b8e2b3b96b7656078549 (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
class Foo<T>
{
	public Foo ()
	{ }

	public void Hello (T t)
	{
		// We're boxing the type parameter `T' to an object here.
		Whatever (t);
	}

	public void Whatever (object o)
	{
		System.Console.WriteLine (o.GetType ());
	}
}

class X
{
	static void Test (Foo<int> foo)
	{
		foo.Hello (4);
	}

	public static void Main ()
	{
		Foo<int> foo = new Foo<int> ();
		Test (foo);
	}
}