Bug 10618 – Template instance member access disallowed in dynamic array allocation

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-11T19:47:00Z
Last change time
2013-07-16T18:13:56Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg
Blocks
10609

Comments

Comment #0 by k.hara.pg — 2013-07-11T19:47:39Z
This is related to bug 9946. Following code should work, but doesn't. template Temp(T) { size_t len = 1; } void main() { auto arr = new int[Temp!int.len]; assert(arr.length == 1); }
Comment #1 by k.hara.pg — 2013-07-11T20:38:35Z
Comment #2 by github-bugzilla — 2013-07-16T18:06:33Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/356a6c999c78173513017da0b29278bd6a8eedd3 fix Issue 10618 - Template instance member access disallowed in dynamic array allocation