[Issue 4746] New: CTFE regression + CTFE/normal execution differences (splitlines).
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Aug 28 14:06:39 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4746
Summary: CTFE regression + CTFE/normal execution differences
(splitlines).
Product: D
Version: D2
Platform: x86_64
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: peter.alexander.au at gmail.com
--- Comment #0 from Peter Alexander <peter.alexander.au at gmail.com> 2010-08-28 14:06:28 PDT ---
This is two bugs at once. The first is a regression in 2.048 from 2.047 where
splitlines is no longer CTFEable. The second is that, in 2.047, splitlines
doesn't work when CTFE'd.
// 2.048
void main()
{
static auto s = splitlines("a\nb"); // Error: not CTFEable
writeln(s[0]);
}
// 2.047
void main()
{
auto s = splitlines("a\nb"); // Note non-static
writeln(s[0]); // Writes 'a'... correct!
}
// 2.047
void main()
{
static auto s = splitlines("a\nb"); // CTFE'd this time
writeln(s[0]); // Writes nothing... incorrect!
}
Note that the 2.048 was run on Windows 7 and the 2.047 was run on Mac OS X Snow
Leopard.
Also note that string.split appears to have the same issue (was CTFEable in
2.047, but not in 2.048).
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list