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

mcs/tests/gtest-anon-28.cs [new file with mode: 0755]

diff --git a/mcs/tests/gtest-anon-28.cs b/mcs/tests/gtest-anon-28.cs
new file mode 100755 (executable)
index 0000000..258dd87
--- /dev/null
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+
+public delegate void Hello ();
+
+struct Foo
+{
+       public int ID;
+
+       public Foo (int id)
+       {
+               this.ID = id;
+       }
+
+       public IEnumerable<Foo> Test (Foo foo)
+       {
+               yield return this;
+               yield return foo;
+       }
+
+       public void Hello (int value)
+       {
+               if (ID != value)
+                       throw new InvalidOperationException ();
+       }
+
+       public override string ToString ()
+       {
+               return String.Format ("Foo ({0})", ID);
+       }
+}
+
+class X
+{
+       static void Main ()
+       {
+               Foo foo = new Foo (3);
+               foreach (Foo bar in foo.Test (new Foo (8)))
+                       Console.WriteLine (bar);
+       }
+}