New test.
authorMartin Baulig <martin@novell.com>
Wed, 4 Oct 2006 20:51:17 +0000 (20:51 -0000)
committerMartin Baulig <martin@novell.com>
Wed, 4 Oct 2006 20:51:17 +0000 (20:51 -0000)
svn path=/trunk/mcs/; revision=66267

1  2 
mcs/tests/gtest-anon-26.cs

index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..4a27f625a1e2961612f24dc36d1e87beb5287df5
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,38 @@@
++using System;
++using System.Collections.Generic;
++
++class MyDisposable : IDisposable
++{
++      static int next_id;
++      int id = ++next_id;
++
++      public void Dispose ()
++      { }
++
++      public int ID {
++              get { return id; }
++      }
++
++      public override string ToString ()
++      {
++              return String.Format ("{0} ({1})", GetType (), id);
++      }
++}
++
++class X
++{
++      public static IEnumerable<int> Test (int a)
++      {
++              MyDisposable d;
++              using (d = new MyDisposable ()) {
++                      yield return a;
++                      yield return d.ID;
++              }
++      }
++
++      static void Main ()
++      {
++              foreach (int a in Test (5))
++                      Console.WriteLine (a);
++      }
++}