Bug 10499 – [REG 2.064] retro is no longer CTFE-able
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-29T02:50:00Z
Last change time
2013-07-08T19:11:38Z
Keywords
CTFE, pull
Assigned to
nobody
Creator
dmitry.olsh
Comments
Comment #0 by dmitry.olsh — 2013-06-29T02:50:21Z
Stripped from new std.uni:
import std.range;
string genUnrolledSwitch(size_t size)
{
foreach(v; iota(0, size).retro())
{
}
return "OK";
}
pragma(msg, genUnrolledSwitch(4));
C:\dmd2\windows\bin\..\..\src\phobos\std\range.d(1462): Error: Declaration static template Result()
is not yet implemented in CTFE
unrolled.d(5): called from here: retro(iota(0, size))
unrolled.d(5): called from here: map(retro(iota(0, size)))
unrolled.d(12): called from here: genUnrolledSwitch(4u)
genUnrolledSwitch(4u)
Failed: "dmd" "-v" "-o-" "unrolled.d" "-I."
Introduced by commit: d8d4c1ea41fcb06ee6e40b8b0e6dc10ade63e11a
It exposed a limitation in CTFE by turning inner struct into an empty-args template (to deduce purity/safety).