[Issue 10499] New: [REG 2.064] retro is no longer CTFE-able

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 29 02:50:23 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10499

           Summary: [REG 2.064] retro is no longer CTFE-able
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: dmitry.olsh at gmail.com


--- Comment #0 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2013-06-29 02:50:21 PDT ---
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).

-- 
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