Bug 9557 – std.array.array of array of immutable structs

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2013-02-21T09:49:00Z
Last change time
2013-10-07T17:27:29Z
Keywords
industry, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2013-02-21T09:49:22Z
import std.array: array; struct Foo { immutable int x; } void main() { immutable a = [Foo(1)]; auto r = a.array(); } DMD 2.062: ...\dmd2\src\phobos\std\array.d(58): Error: cannot modify struct result[i] Foo with immutable members test.d(7): Error: template instance std.array.array!(immutable(Foo)[]) error instantiating
Comment #1 by jcrapuchettes — 2013-10-07T16:22:15Z
I can confirm this issue for DMD 2.063.2 x86_64 linux, but it appears that it is fixed in git HEAD.
Comment #2 by bearophile_hugs — 2013-10-07T17:27:29Z
(In reply to comment #1) > I can confirm this issue for DMD 2.063.2 x86_64 linux, but it appears that it > is fixed in git HEAD. Cool. Closed.