[Mono-bugs] [Bug 508729] New: gmcs does not resolve problems with IEnumerator<T>/IEnumerator and IEnumerable<T>/IEnumerable implementation

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jun 1 11:44:59 EDT 2009


           Summary: gmcs does not resolve problems with
                    IEnumerator<T>/IEnumerator and
                    IEnumerable<T>/IEnumerable implementation
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.4.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: bojanr at brandeis.edu
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

Created an attachment (id=295494)
 --> (http://bugzilla.novell.com/attachment.cgi?id=295494)
Output log from csc.

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b4)
Gecko/20090423 Firefox/3.5b4 (.NET CLR 4.0.20506)

gmcs does not properly reproduce problems with the implementation of
IEnumerator<T>/IEnumerator and IEnumerable<T>/IEnumerable. When implementing
the interfaces, gmcs will happily allow you to only have a generic
IEnumerator<T> GetEnumerator call, which does not match the Microsoft behavior.
What's worse is that once happily letting you do so, it causes a runtime crash
in Mono, with a message of missing implementation of
System.Collections.IEnumerator::get_Current () (pointing to the problem).
Attached is some sample code that demonstrates the issue, the outpupt of gmcs
and mono on the executable produced, and the output of csc.

Reproducible: Always

Steps to Reproduce:
1. compile sample code
2. gmcs compiles, csc fails to
3. run with mono
Actual Results:  
Segfault in native code in Mono.

Expected Results:  
gmcs should not compile this code.

gmcs version:

bojan at blackforest:/home/bojan
[0] $ gmcs2 --version
Mono C# compiler version

csc version:

Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.1
for Microsoft (R) .NET Framework version 3.5

Mono version:

bojan at blackforest:/home/bojan
[0] $ mono --version
Mono JIT compiler version 2.4 (Debian 2.4+dfsg-1~pre2)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        GC:            Included Boehm (with typed GC)
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none

Configure bugmail: http://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