dmd 2.049 bug with take and SList?
nospam at example.net
Wed Oct 13 09:46:09 PDT 2010
I'm new to D2 ranges but have been following D for some time. I'm posting
here because I want to check if I'm doing anything wrong before filing a
The code below is a test case I made after hitting the problem in real
code. Basically the pyramid recursive function should print out:
[1, 2, 3]
This works fine when calling with an int range, but calling with
SList!int seems to make the compiler hang, eating up memory.
Should I file a bug?
void pyramid(Range)(Range items)
auto len = walkLength(items);
auto r = take(items, len - 1);
/* array version is fine */
int arr = [1, 2, 3];
SList!int list = [1, 2, 3];
pyramid(list); /* infinite loop with dmd 2.049 */
More information about the Digitalmars-d-learn