Bug 6460 – [CTFE] internal error assigning struct

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-08-09T13:56:00Z
Last change time
2011-08-11T23:39:26Z
Assigned to
nobody
Creator
dmitry.olsh

Comments

Comment #0 by dmitry.olsh — 2011-08-09T13:56:27Z
Test case: int f() { struct FixedStack(T) { T[] arr; //commenting out this constructor makes it work this(T[] storage){ arr = storage; } } auto counterRange = FixedStack!uint(new uint[22]); return 0; } enum k = f(); dmd's output: struct.d(9): Error: CTFE internal error assigning struct struct.d(13): Error: cannot evaluate f() at compile time
Comment #1 by ellery-newcomer — 2011-08-11T18:41:53Z
I ran into this a while ago: import std.algorithm; void main(){ size_t findi(string s){ return countUntil(s,'d'); }; enum x = map!findi(["a","b"]); } on my example dmd also segfaults.
Comment #2 by clugdbug — 2011-08-11T23:39:26Z
*** This issue has been marked as a duplicate of issue 6419 ***