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

--- Comment #0 from 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
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:
------- You are receiving this mail because: -------

Reply via email to