Bug 8763 – struct initialization with empty variadic arguments tries to call constructor

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-10-05T03:17:00Z
Last change time
2014-02-12T03:27:40Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
monarchdodra

Comments

Comment #0 by monarchdodra — 2012-10-05T03:17:07Z
//---- 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
Comment #1 by github-bugzilla — 2013-02-07T05:14:57Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/aecbaea6cfddf10f3766a0c4c5bf846de94b9cf1 Workaround for bug# 8763 for std.container.make. https://github.com/D-Programming-Language/phobos/commit/bb25033007622e341eb3aad6ad501dd2bec4dd42 Merge pull request #1119 from jmdavis/container Workaround for bug# 8763 for std.container.make.
Comment #2 by k.hara.pg — 2013-02-09T01:58:39Z
Comment #3 by github-bugzilla — 2013-02-09T02:43:07Z
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 Merge pull request #1651 from 9rnsr/fix8763 Issue 8763 - struct initialization with empty variadic arguments tries to call constructor
Comment #4 by monarchdodra — 2014-02-12T03:27:40Z
*** Issue 8282 has been marked as a duplicate of this issue. ***