Bug 5940 – Cannot create arrays of std.algorithm.map

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-05-06T22:38:00Z
Last change time
2011-05-09T17:59:10Z
Keywords
rejects-valid
Assigned to
nobody
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2011-05-06T22:38:00Z
import std.algorithm; void main() { auto stuff = [map!"a * 2"([1, 2, 3]), map!"a * 2"([4, 5, 6]) ]; } Result on DMD 2.053 beta: test9.d(5): Error: cannot have array of inner structs Result
Comment #1 by kennytm — 2011-05-06T23:29:24Z
See as issue 4274.
Comment #2 by bugzilla — 2011-05-08T22:50:11Z
Reduced test case: template map(fun...) { auto map(double[] r) { struct Result { this(double[] input) { } } return Result(r); } } void test() { double[] x; auto a = [map!"a"(x)]; }
Comment #3 by bugzilla — 2011-05-09T17:59:10Z
I "fixed" this by removing the check for it. I think it's good, but we'll see. https://github.com/D-Programming-Language/dmd/commit/c8f6cda3076b869b3bace306c25210f7ea5a7c33