Hey,

The following code crashes with DMD64 D Compiler v2.071.2:

import std.algorithm;
import std.stdio;
import std.range;

int main()
{
  repeat(8, 10).chunks(3).writeln();

  return 0;
}

Error message:

pure nothrow @nogc @safe std.range.Take!(std.range.Repeat!(int).Repeat).Take std.range.Repeat!(int).Repeat.opSlice(ulong, ulong)

If I replace repeat with iota, or a literal range (like [1, 2 ,3, 4]), I don't get the crash.

I don't see why I should not be able to use chunks with repeat.
If some property of repeat's range is missing to use chunks, shouldn't I get an error message ?

Am I missing something ?

PS: the behavior has been reproduced on someone else computer.

Cheers :)

Reply via email to