[Mono-bugs] [Bug 409030] New: gmcs: error CS1579 foreach on TableLayoutStyleCollection

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jul 14 15:23:30 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=409030


           Summary: gmcs: error CS1579 foreach on TableLayoutStyleCollection
           Product: Mono: Compilers
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: andyhume32 at yahoo.co.uk
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


[[
using System;
using System.Windows.Forms;

class ForeachT {
   static void Main()
   {
       // blah
   }

        private static void ReplaceContentsWith<T> (T src, T dst)
                where T : TableLayoutStyleCollection
        {
                dst.Clear ();
                foreach (TableLayoutStyle cur in src)
                        dst.Add (cur);
        }
}
]]

"gmcs ForeachT.cs /pkg:dotnet" fails with:
[[
ForeachT.cs(18,17): error CS1579: foreach statement cannot operate on variables
of type `T' because it does not contain a definition for `GetEnumerator' or is
not accessible
]]

Work in MSFT.  Fails in all Mono versions, well at least SVN, 1.9, and 1.2.5.

Don't know what's special about that collection type…


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list