[Mono-bugs] [Bug 477378] New: [Regression] Compiler disallows default(SomeType) for values in anonymous types

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Feb 18 13:57:16 EST 2009


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


           Summary: [Regression] Compiler disallows default(SomeType) for
                    values in anonymous types
    Classification: Mono
           Product: Mono: Compilers
           Version: SVN
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: dmitchell at logos.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us)
AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1

Here's some code:

---

using System;

namespace MonoBug
{
    public static class Program
    {
        public static void Main()
        {
            var foo = new { Value = default(string) };
            Console.WriteLine(foo.Value);
        }
    }
}

---

It works under csc and gmcs 2.2, but it fails in gmcs from svn.

Reproducible: Always

Steps to Reproduce:
1. Put the code above into a cs file
2. Try to build with gmcs
Actual Results:  
Compilation fails with CS0828.

Expected Results:  
Compilation should succeed.

Possibly related to bug 476811.

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