зеркало из https://github.com/mono/mail-archives.git
169 строки
4.9 KiB
HTML
169 строки
4.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [Mono-bugs] [Bug 75427][Maj] New - Iterators cannot be defined in
|
|
one accessor only
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2075427%5D%5BMaj%5D%20New%20-%20Iterators%20cannot%20be%20defined%20in%0A%09one%20accessor%20only&In-Reply-To=bug-75427%40chernobyl.ximian.com">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<LINK REL="Previous" HREF="031205.html">
|
|
<LINK REL="Next" HREF="031207.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[Mono-bugs] [Bug 75427][Maj] New - Iterators cannot be defined in
|
|
one accessor only</H1>
|
|
<B>bugzilla-daemon at bugzilla.ximian.com</B>
|
|
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2075427%5D%5BMaj%5D%20New%20-%20Iterators%20cannot%20be%20defined%20in%0A%09one%20accessor%20only&In-Reply-To=bug-75427%40chernobyl.ximian.com"
|
|
TITLE="[Mono-bugs] [Bug 75427][Maj] New - Iterators cannot be defined in
|
|
one accessor only">bugzilla-daemon at bugzilla.ximian.com
|
|
</A><BR>
|
|
<I>Thu Jun 30 09:23:50 EDT 2005</I>
|
|
<P><UL>
|
|
<LI>Previous message: <A HREF="031205.html">[Mono-bugs] [Bug 75393][Maj] Changed - TSQL end of statement marker
|
|
; invalid
|
|
</A></li>
|
|
<LI>Next message: <A HREF="031207.html">[Mono-bugs] [Bug 75359][Nor] Changed - Wrong behavior of MONO SWF
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#31206">[ date ]</a>
|
|
<a href="thread.html#31206">[ thread ]</a>
|
|
<a href="subject.html#31206">[ subject ]</a>
|
|
<a href="author.html#31206">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>Please do not reply to this email- if you want to comment on the bug, go to the
|
|
URL shown below and enter your comments there.
|
|
|
|
Changed by <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">marek.safar at seznam.cz.</A>
|
|
|
|
<A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=75427">http://bugzilla.ximian.com/show_bug.cgi?id=75427</A>
|
|
|
|
--- shadow/75427 2005-06-30 09:23:50.000000000 -0400
|
|
+++ shadow/75427.tmp.22941 2005-06-30 09:23:50.000000000 -0400
|
|
@@ -0,0 +1,97 @@
|
|
+Bug#: 75427
|
|
+Product: Mono: Compilers
|
|
+Version: 1.1
|
|
+OS:
|
|
+OS Details:
|
|
+Status: NEW
|
|
+Resolution:
|
|
+Severity:
|
|
+Priority: Major
|
|
+Component: C#
|
|
+AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at ximian.com</A>
|
|
+ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">marek.safar at seznam.cz</A>
|
|
+QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at ximian.com</A>
|
|
+TargetMilestone: ---
|
|
+URL:
|
|
+Cc:
|
|
+Summary: Iterators cannot be defined in one accessor only
|
|
+
|
|
+Please fill in this template when reporting a bug, unless you know what you
|
|
+are doing.
|
|
+Description of Problem:
|
|
+
|
|
+
|
|
+Steps to reproduce the problem:
|
|
+1.
|
|
+
|
|
+using System;
|
|
+using System.Collections;
|
|
+
|
|
+class X {
|
|
+ static IEnumerator GetIt
|
|
+ {
|
|
+ get {
|
|
+ yield return 1;
|
|
+ yield return 2;
|
|
+ yield return 3;
|
|
+ }
|
|
+ set
|
|
+ {
|
|
+ }
|
|
+ }
|
|
+
|
|
+ IEnumerable this [int i]
|
|
+ {
|
|
+ get {
|
|
+ yield return 1*i;
|
|
+ yield return 2*i;
|
|
+ yield return 3*i;
|
|
+ }
|
|
+ set
|
|
+ {
|
|
+ }
|
|
+ }
|
|
+
|
|
+ static int Main ()
|
|
+ {
|
|
+ IEnumerator e = GetIt;
|
|
+ int total = 0;
|
|
+
|
|
+ while (e.MoveNext ()){
|
|
+ Console.WriteLine ("Value=" + e.Current);
|
|
+ total += (int) e.Current;
|
|
+ }
|
|
+
|
|
+ if (total != 6)
|
|
+ return 1;
|
|
+
|
|
+ total = 0;
|
|
+ X x = new X ();
|
|
+ foreach (int i in x [2]){
|
|
+ Console.WriteLine ("Value=" + i);
|
|
+ total += i;
|
|
+ }
|
|
+ if (total != 12)
|
|
+ return 2;
|
|
+
|
|
+ return 0;
|
|
+ }
|
|
+}
|
|
+
|
|
+
|
|
+Actual Results:
|
|
+
|
|
+error CS1624: The body of `X.GetIt.set' cannot be an iterato
|
|
+r block because `void' is not an iterator interface type
|
|
+error CS1624: The body of `X.this[int].set' cannot be an ite
|
|
+rator block because `void' is not an iterator interface type
|
|
+
|
|
+
|
|
+Expected Results:
|
|
+
|
|
+No errors
|
|
+
|
|
+How often does this happen?
|
|
+
|
|
+
|
|
+Additional Information:
|
|
</PRE>
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI>Previous message: <A HREF="031205.html">[Mono-bugs] [Bug 75393][Maj] Changed - TSQL end of statement marker
|
|
; invalid
|
|
</A></li>
|
|
<LI>Next message: <A HREF="031207.html">[Mono-bugs] [Bug 75359][Nor] Changed - Wrong behavior of MONO SWF
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#31206">[ date ]</a>
|
|
<a href="thread.html#31206">[ thread ]</a>
|
|
<a href="subject.html#31206">[ subject ]</a>
|
|
<a href="author.html#31206">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
|
|
<hr>
|
|
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
|
|
mailing list</a><br>
|
|
</body></html>
|