2010-04-14 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / gtest-anon-9.cs
blob0af13b8f997fdbf9730ac60e524d0964fa30f74c
1 using System;
2 using System.Collections;
3 using System.Collections.Generic;
5 public delegate void Foo ();
7 public class Test
9 public static implicit operator Foo (Test test)
11 return delegate { Console.WriteLine ("Hello World!"); };
14 public static IEnumerable<Test> operator + (Test test, Test foo)
16 yield return test;
17 yield return foo;
20 public IEnumerable<int> Foo {
21 get {
22 yield return 3;
25 set {
26 Console.WriteLine ("Foo!");
30 static void Main ()
32 Test test = new Test ();
33 Foo foo = test;
34 foo ();
35 foreach (Test t in test + test)
36 Console.WriteLine (t);