Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-iter-24.cs
1 using System;
2 using System.Collections.Generic;
3
4 public class B : IDisposable
5 {
6         public void Dispose ()
7         {
8         }
9
10         public void DoSomething ()
11         {
12         }
13 }
14
15 public class C
16 {
17         public static IEnumerable<int> Test ()
18         {
19                 using (var b = new B ()) {
20                         Action a = () => b.DoSomething ();
21                         a ();
22
23                         yield return 1;
24                 }
25         }
26         
27         public static int Main ()
28         {
29                 foreach (var e in Test ()) {
30                         Console.WriteLine (e);
31                 }
32                 
33                 return 0;
34         }
35 }