[Issue 6653] New: [CTFE] internal error assigning struct
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Sep 12 12:29:11 PDT 2011
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: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at 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: -------
More information about the Digitalmars-d-bugs
mailing list