summaryrefslogtreecommitdiff
path: root/mcs/tests/gtest-variance-10.cs
blob: 8c66d99528482b423d6eaaad79201ebc7c7baf84 (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
using System;

public interface I<out T>
{
	int Count{ get; }
}

class Foo {}

public class Test : I<string>, I<Foo>
{
	int I<string>.Count
	{
		get { return 1; }
	}
	
	int I<Foo>.Count
	{
		get { return 2; }
	}
}

public static class Program
{
	public static int Main ()
	{
		var col = new Test();

		var test = (I<object>)(object) col;
		if (test.Count != 1)
			return 1;
		
		return 0;
	}
}