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

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

class MyList<T> : IEnumerable<T>
{
	public IEnumerator<T> GetEnumerator ()
	{
		yield break;
	}

	IEnumerator IEnumerable.GetEnumerator ()
	{
		return GetEnumerator ();
	}
}

struct Foo<T>
{
	public readonly T Data;
  
	public Foo (T data)
	{
		this.Data = data;
	}
}

class X
{
	static void Main ()
	{
		MyList<Foo<int>> list = new MyList <Foo<int>> ();
		foreach (Foo<int> foo in list)
			;
	}
}