[LoongArch64] Part-5:add loongarch support in some files for LoongArch64. (#21769)
[mono-project.git] / mcs / tests / test-anon-107.cs
blob943502a1f0defb4c50c94cda3601acf0a1f1a75a
1 using System;
2 using System.Collections.Generic;
4 class MyDisposable : IDisposable
6 static int next_id;
7 int id = ++next_id;
9 public void Dispose ()
10 { }
12 public int ID {
13 get { return id; }
16 public override string ToString ()
18 return String.Format ("{0} ({1})", GetType (), id);
22 class X
24 public static IEnumerable<int> Test (int a)
26 MyDisposable d;
27 using (d = new MyDisposable ()) {
28 yield return a;
29 yield return d.ID;
33 public static void Main ()
35 foreach (int a in Test (5))
36 Console.WriteLine (a);