[Mono-dev] Compiler bug in foreach

Alan McGovern alan.mcgovern at gmail.com
Sun May 30 11:53:37 EDT 2010


There was a regression in trunk about 2 weeks ago which was fixed
about 4 days ago which was very similar to this. However your testcase
appears to fail on both mono 2.6.4 and svn trunk. Would you be able to
file a bug report with this testcase?

Thanks!
Alan.

On Sat, May 29, 2010 at 2:11 AM, Robert Jordan <robertj at gmx.net> wrote:
> On 29.05.2010 01:44, Mehrdad Reshadi wrote:
>> I found the following bug, wondering if others have seen this, or anything
>> is being done to solve it. "foreach" is too common to have such a bug!
>
>>          public static void Main(string[] args)
>>          {
>>              var o = new Y();
>>              foreach (var c in new A[3] { new A(), new B(), new C() })
>>                  c.f(o);
>>              new B().f(o);
>>          }
>
> "foreach" is obviously not the culprit, because the issue can
> be reproduced with an unrolled loop:
>
>         public static void Main(string[] args)
>         {
>             var o = new Y();
>             var a = new A[3] { new A(), new B(), new C() };
>            a[0].f(o);
>            a[1].f(o);
>            a[2].f(o);
>             new B().f(o);
>         }
>
> Please visit http://mono-project.com/Bugs and file a bug.
>
> Robert
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>


More information about the Mono-devel-list mailing list