Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2004-08-23 00:07:53 +0400
committerMarek Safar <marek.safar@gmail.com>2004-08-23 00:07:53 +0400
commit6807edf7d9d75650624f2d6a2674ee01b2f0baa8 (patch)
tree1cfd5aed091afd168f812b442f0423e4d8a4c62d /mcs/errors/cs1579-2.cs
parent2d436d0ff08d62e33d325dd9a3ea623c2da1d049 (diff)
new error tests
svn path=/trunk/mcs/; revision=32664
Diffstat (limited to 'mcs/errors/cs1579-2.cs')
-rw-r--r--mcs/errors/cs1579-2.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/mcs/errors/cs1579-2.cs b/mcs/errors/cs1579-2.cs
new file mode 100644
index 00000000000..3eb3e415d32
--- /dev/null
+++ b/mcs/errors/cs1579-2.cs
@@ -0,0 +1,23 @@
+// cs1579.cs: foreach statement cannot operate on variables of type 'Foo' because 'Foo' does not contain a public definition for 'GetEnumerator'
+// Line: 12
+
+using System;
+using System.Collections;
+
+public class Test
+{
+ public static void Main ()
+ {
+ Foo f = new Foo ();
+ foreach (object o in f)
+ Console.WriteLine (o);
+ }
+}
+
+public class Foo
+{
+ internal IEnumerator GetEnumerator ()
+ {
+ return new ArrayList ().GetEnumerator ();
+ }
+} \ No newline at end of file