Bug 8233 – std.array.array fails to compile with ranges of immutable elements which have a length property

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-06-13T01:25:00Z
Last change time
2015-06-09T01:31:23Z
Assigned to
nobody
Creator
issues.dlang

Comments

Comment #0 by issues.dlang — 2012-06-13T01:25:48Z
This fails to compile import std.array; void main() { dstring d = "hello world"; auto e = array(d); } giving /home/jmdavis/dmd2/linux/bin/../../src/phobos/std/array.d(55): Error: result[i] isn't mutable q.d(6): Error: template instance std.array.array!(immutable(dchar)[]) error instantiating If you use string rather than dstring, it works just fine. The line that fails to compile in std.array.array is in the hasLength!Range portion, so clearly it's an issue specifically with ranges which have a length property.
Comment #1 by issues.dlang — 2012-06-13T01:50:59Z
Comment #2 by github-bugzilla — 2012-06-13T21:16:55Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/5c3d2199316ab24c0cb3cffbacb83d41190459e7 Fix for issue# 8233. std.array.array fails to compile with ranges of immutable elements which have a length property https://github.com/D-Programming-Language/phobos/commit/c05e6e4ccea6b4a3a2097abc9d4b5c82e0213c91 Merge pull request #630 from jmdavis/8233 Fix for issue# 8233.
Comment #3 by github-bugzilla — 2012-06-13T21:20:10Z