Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-iter-14.cs
1 //
2 // Sample for bug 75674
3 //
4 using System;
5 using System.Collections;
6
7 class XX {
8         static void Metodo (Exception e)
9         {
10                 if (e is NotImplementedException){
11                         Console.WriteLine ("OK");
12                 } else {
13                         Console.WriteLine ("Fail");
14                 }
15         }
16         
17         static IEnumerable X ()
18         {
19                 try {
20                         throw new NotImplementedException ();
21                 } catch (Exception e){
22                         Metodo (e);
23                 }
24                 yield return 0;
25         }
26         
27         public static void Main ()
28         {
29                 foreach (int a in X ()){
30                 }
31         }
32 }