Bug 7756 – iota(const doubles) problem

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-03-23T16:11:00Z
Last change time
2015-06-09T05:14:51Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2012-03-23T16:11:31Z
This program compiles with no errors: import std.range, std.array; void main() { alias const int CC; array(iota(cast(CC)0, cast(CC)10, cast(CC)1)); } While this: import std.range, std.array; void main() { alias const double CC; array(iota(cast(CC)0.0, cast(CC)10.0, cast(CC)1.0)); } Gives with DMD 2.059head: ...\dmd2\src\phobos\std\array.d(55): Error: result[i] isn't mutable test.d(4): Error: template instance std.array.array!(Result) error instantiating Elsewhere there is a bug report about array() of const items.
Comment #1 by irritate — 2013-06-18T18:57:57Z
Issue does not occur for me on head revision, DMD v2.064.
Comment #2 by bearophile_hugs — 2013-06-19T02:44:25Z
(In reply to comment #1) > Issue does not occur for me on head revision, DMD v2.064. Good. Closed.