[Issue 11702] New: std.string.splitLines to immutable result
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Dec 7 05:53:21 PST 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11702
Summary: std.string.splitLines to immutable result
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2013-12-07 05:53:19 PST ---
void main() pure {
import std.string;
immutable parts = "5\n6".splitLines;
}
splitLines can be used in a pure function, but its result can't yet be assigned
to an immutable (dmd 2.065alpha):
temp.d(3): Error: cannot implicitly convert expression (splitLines("5\x0a6",
cast(KeepTerminator)false)) of type string[] to immutable(char[][])
Even this fails with a similar error:
void main() pure {
import std.string;
immutable s = "5\n6";
immutable parts = s.splitLines;
}
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list