www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8763] New: struct initialization with empty variadic arguments tries to call constructor

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

           Summary: struct initialization with empty variadic arguments
                    tries to call constructor
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: monarchdodra gmail.com



//----
struct S
{
    this(int);
}

void foo(T, Args...)(Args args)
{
    T t = T(args); Error: constructor main.S.this (int) is not callable using
argument types ()
}
void main()
{
    S t = S(); //OK, initialize to S.init
    foo!S();
}
//----
Basically, the compiler gets confused about "T(args)", and tries to call S's
constructor "this(int)".

Proper behavior would be to call "T()" and initialize to T.init

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 05 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8763




Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/aecbaea6cfddf10f3766a0c4c5bf846de94b9cf1


https://github.com/D-Programming-Language/phobos/commit/bb25033007622e341eb3aad6ad501dd2bec4dd42




-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 07 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8763


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

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



https://github.com/D-Programming-Language/dmd/pull/1651

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 09 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8763




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/92cd2d161e8ca9df26f84fd32a07540a02f7a988
fix Issue 8763 - struct initialization with empty variadic arguments tries to
call constructor

https://github.com/D-Programming-Language/dmd/commit/20c42d0df58afbbcb1384d8875351687263a5d76


Issue 8763 - struct initialization with empty variadic arguments tries to call
constructor

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 09 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8763


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
            Version|unspecified                 |D2
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 09 2013