www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7073] New: Parsing of class-returning varargs function inside module ctor fails

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7073

           Summary: Parsing of class-returning varargs function inside
                    module ctor fails
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: xtzgzorex gmail.com



06:47:21 PST ---
Code:

class A
{
}

static this()
{
    A foo(A[] a ...)
    {
        return new A();
    }
}

Errors:

test.d(7): found 'foo' when expecting ';' following statement
test.d(11): found '}' when expecting ';' following statement
test.d(12): found 'EOF' when expecting '}' following compound statement

Removing the "..." makes it parse correctly.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 06 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7073




07:07:37 PST ---

 Code:
 
 class A
 {
 }
 
 static this()
 {
     A foo(A[] a ...)
     {
         return new A();
     }
 }
 
 Errors:
 
 test.d(7): found 'foo' when expecting ';' following statement
 test.d(11): found '}' when expecting ';' following statement
 test.d(12): found 'EOF' when expecting '}' following compound statement
 
 Removing the "..." makes it parse correctly.
Also fails with this simpler example: static this() { string f(int[] arr...) { } } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 06 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7073


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch, rejects-valid



D2 patch:
https://github.com/D-Programming-Language/dmd/pull/601

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 02 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7073


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



12:33:12 PST ---
https://github.com/D-Programming-Language/dmd/commit/74520a3de533c12f484ee1e8329f492beaa3fba4

https://github.com/D-Programming-Language/dmd/commit/9524e90d3640ab1467b1e2534bb1a2e5f152f627

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 05 2012