[Mono-bugs] [Bug 570422] New: Mono allows return false in method returning IEnumerable<T> .NET C# does not.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jan 13 13:07:26 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=570422

http://bugzilla.novell.com/show_bug.cgi?id=570422#c0


           Summary: Mono allows return false in method returning
                    IEnumerable<T> .NET C# does not.
    Classification: Mono
           Product: Mono: Compilers
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Minor
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: tom_hindle at sil.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=336453)
 --> (http://bugzilla.novell.com/attachment.cgi?id=336453)
Test case that should fail to compile with CS1622 and CS0029

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7)
Gecko/20100106 Ubuntu/9.10 (karmic) Firefox/3.5.7

This is no big deal : should be doing a yield break anyway.

// This should not compile.
protected static IEnumerable<MyObj> GetStuff ()
{
    yield return null;

    try{}
    catch
    {
        return false;
    }                
}

Attaching Test case.

Reproducible: Always

Steps to Reproduce:
1. Compile Attached Test Case
2.
3.
Actual Results:  
Compiles ok.

Expected Results:  
CS1622, CS0029

-- 
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