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

           Summary: [CTFE] internal error assigning struct
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-09-12 12:28:53 PDT ---
Maybe this is an enhancement request. D2 code:


import std.algorithm;
int sqr(in int x) pure nothrow { return x * x; }
enum r = map!sqr([3, 6]);
void main() {}


DMD 2.055 gives:

...\src\phobos\std\algorithm.d(459): Error: CTFE internal error assigning
struct
test.d(3): Error: cannot evaluate map([3,6]) at compile time

------------------

I don't know if an enum range is meaningful, my final purpose was to create a
compile-time constant array:

enum int[] r = array(map!sqr([3, 6]));

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to