Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-anon-109.cs
1 using System;
2 using System.Collections;
3 using System.Collections.Generic;
4
5 public delegate void Foo ();
6
7 public class Test
8 {
9         public static implicit operator Foo (Test test)
10         {
11                 return delegate { Console.WriteLine ("Hello World!"); };
12         }
13
14         public static IEnumerable<Test> operator + (Test test, Test foo)
15         {
16                 yield return test;
17                 yield return foo;
18         }
19
20         public IEnumerable<int> Foo {
21                 get {
22                         yield return 3;
23                 }
24
25                 set {
26                         Console.WriteLine ("Foo!");
27                 }
28         }
29
30         public static void Main ()
31         {
32                 Test test = new Test ();
33                 Foo foo = test;
34                 foo ();
35                 foreach (Test t in test + test)
36                         Console.WriteLine (t);
37         }
38 }