Take stars out of types where they make more sense.
[mono-project.git] / mcs / tests / test-iter-08.cs
blob562b1a526a41a0b9c5390f9f2af399ac232adb1d
1 // Compiler options: -langversion:default
3 using System;
4 using System.Collections;
6 public class Foo : IDisposable
8 public readonly int Data;
10 public Foo (int data)
12 this.Data = data;
15 public bool disposed;
17 public void Dispose ()
19 disposed = true;
23 class X
25 public static IEnumerable Test (int a, int b)
27 Foo foo3, foo4;
29 using (Foo foo1 = new Foo (a), foo2 = new Foo (b)) {
30 yield return foo1.Data;
31 yield return foo2.Data;
33 foo3 = foo1;
34 foo4 = foo2;
37 yield return foo3.disposed;
38 yield return foo4.disposed;
41 public static int Main ()
43 ArrayList list = new ArrayList ();
44 foreach (object data in Test (3, 5))
45 list.Add (data);
47 if (list.Count != 4)
48 return 1;
49 if ((int) list [0] != 3)
50 return 2;
51 if ((int) list [1] != 5)
52 return 3;
53 if (!(bool) list [2])
54 return 4;
55 if (!(bool) list [3])
56 return 5;
58 return 0;