Bug 11581 – Given T..., new T[0] does not work

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-22T07:48:00Z
Last change time
2016-02-07T01:23:02Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
luis

Comments

Comment #0 by luis — 2013-11-22T07:48:34Z
I'm not sure, but this seems a bug: class X(T...) if(T.length > 0) { T[0] foo() { return new T[0]; } } class A : X!A {} Error: can't have array of (A) Workaround: class X(T...) if(T.length > 0) { T[0] foo() { alias T0 = T[0]; return new T0; } }
Comment #1 by k.hara.pg — 2015-08-10T17:21:29Z
*** Issue 14899 has been marked as a duplicate of this issue. ***
Comment #2 by k.hara.pg — 2015-08-11T11:09:13Z
Comment #3 by github-bugzilla — 2016-02-07T01:23:02Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/d93d396842d84c57ddbbaf29e2509c9a9310978c fix Issue 11581 - Given T..., new T[0] does not work Defer the indexing form check until NewExp::semantic. https://github.com/D-Programming-Language/dmd/commit/b583111eb52760ee7c29cc4d862109bc806f2471 Merge pull request #4878 from 9rnsr/fix11581 Issue 11581 - Given T..., new T[0] does not work