[Mono-bugs] [Bug 498174] New: gmcs requires ()/[] in 'new' when not	needed.
    bugzilla_noreply at novell.com 
    bugzilla_noreply at novell.com
       
    Fri Apr 24 15:07:05 EDT 2009
    
    
  
http://bugzilla.novell.com/show_bug.cgi?id=498174
           Summary: gmcs requires ()/[] in 'new' when not needed.
    Classification: Mono
           Product: Mono: Compilers
           Version: SVN
          Platform: x86-64
        OS/Version: openSUSE 11.1
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jpryor at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
gmcs (mono-trunk) in r132609 always wants () or [] in a 'new' expression even
if it isn't needed -- for example, with collection initializers.
Example:
  // collection initializers...
  using System;
  using System.Collections.Generic;
  class Test {
    public static void Main ()
    {
      new List<string> { Foo(1), Foo(2) };
    }
    static string Foo (int n)
    {
      return n.ToString ();
    }
  }
With r132609:
ci.cs(8,42): error CS1526: A new expression requires () or [] after type
ci.cs(8,42): error CS8032: Internal compiler error during parsing, Run with -v
for details
With Mono 2.0 (openSUSE 11.1), or Mono 2.4, or .NET 3.5 CSC, this code compiles
without error.
To workaround, within mcs/mcs, run
$ svn up -r132591 .
-- 
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