http://d.puremagic.com/issues/show_bug.cgi?id=9867
Summary: Map opIndex is not usable with immutable types
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Andrej Mitrovic <[email protected]> 2013-04-03
11:49:33 PDT ---
import std.algorithm;
private immutable string[12] longMonthNames = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
];
immutable shortMonthNames = map!(a => a[0..3])(longMonthNames[]); // L24
void main()
{
string jan = shortMonthNames[0];
}
test.d(24): Error: mutable method test.MapResult!(__lambda2,
immutable(char[])[]).MapResult.opIndex is not callable using a immutable object
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------