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

gtest-302.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fd3f6f93bb2fcc6a634979e16242cd9c49e7348d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System;
using System.Collections;
using System.Collections.Generic;

interface ITest : IEnumerable<int> {
}

class Test : ITest {
	IEnumerator IEnumerable.GetEnumerator () { throw new Exception (); }
	IEnumerator<int> IEnumerable<int>.GetEnumerator () { yield break; }
}

class M {
	public static void Main ()
	{
		ITest foo = new Test ();
		foreach (int i in foo)
			Console.WriteLine (i);
	}
}