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