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

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

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

class A<T> where T : IDisposable
{
	public virtual bool Test<U> (U u) where U : T
	{
		using (u) {
			return false;
		}
	}
}

class B : A<S>
{
	public override bool Test<U> (U u)
	{
		using (u) {
			return true;
		}
	}

	public static int Main ()
	{
		var b = new B ();
		if (!b.Test (new S ()))
			return 1;

		return 0;
	}
}