summaryrefslogtreecommitdiff
path: root/mcs/tests/gtest-557.cs
blob: 494526b537b4b3520773140c126441a1cd31038f (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
using System.Collections.Generic;

class Test
{
	static U[] Foo<T, U> (T[] arg) where T : class, U
	{
		return arg;
	}

	static void TestByRef<T> ()
	{
		T[] array = new T[10];
		PassByRef (ref array[0]);
	}

	static void PassByRef<T> (ref T t)
	{
		t = default (T);
	}

	public static int Main ()
	{
		foreach (var e in Foo<string, object> (new string[] { "as" })) {
		}

		TestByRef<byte> ();

		return 0;
	}
}