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

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

class R<T, U>
	where T : System.IDisposable
	where U : T
{
	public void M (U u)
	{
		using (u) {
		}
	}
}

struct S<T, U>
	where T : System.IDisposable
	where U : struct, T
{
	public void M (U u)
	{
		using (u) {
		}
	}
}

class X : IDisposable
{
	public void Dispose ()
	{
	}

	public static void Main ()
	{
		new R<X, X> ().M (new X ());
		new S<Y, Y> ().M (new Y ());
	}
}

struct Y : IDisposable
{
	public void Dispose ()
	{
	}
}