summaryrefslogtreecommitdiff
path: root/mcs/tests/gtest-338.cs
blob: 112d6ec835d3a83170c441c9aca0a54cb7160c32 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
using System;
using System.Collections;
using System.Collections.Generic;

class Test {

	public static void Main ()
	{
		FooList<string> l = new FooList<string> ();
		Foo<string> (l);
	}

	static void Foo<T> (IList<T> list)
	{
		ICollection coll = list as ICollection;
		if (coll != null)
			Console.WriteLine (coll.Count);
	}
}

public class FooList<T> : IList<T> {

	public int IndexOf (T item)
	{
		throw new NotImplementedException ();
	}

	public void Insert (int index, T item)
	{
		throw new NotImplementedException ();
	}

	public void RemoveAt (int index)
	{
		throw new NotImplementedException ();
	}

	public T this [int index]
	{
		get { throw new NotImplementedException (); }
		set { throw new NotImplementedException (); }
	}

	public void Add (T item)
	{
		throw new NotImplementedException ();
	}

	public void Clear ()
	{
		throw new NotImplementedException ();
	}

	public bool Contains (T item)
	{
		throw new NotImplementedException ();
	}

	public void CopyTo (T [] array, int arrayIndex)
	{
		throw new NotImplementedException ();
	}

	public bool Remove (T item)
	{
		throw new NotImplementedException ();
	}

	public int Count
	{
		get { throw new NotImplementedException (); }
	}

	public bool IsReadOnly
	{
		get { throw new NotImplementedException (); }
	}

	IEnumerator<T> IEnumerable<T>.GetEnumerator ()
	{
		throw new NotImplementedException ();
	}

	public IEnumerator GetEnumerator ()
	{
		throw new NotImplementedException ();
	}
}