Reduced test case:
------
struct S(T)
{
import std.range;
}
unittest
{
auto a1 = S!int();
foreach(i, e; a1)
{
}
}
------
Seems this has nothing to do with sortedRange, it's a compiler bug.
Comment #2 by hsteoh — 2014-09-11T20:54:26Z
OK, managed to cut it down to an almost bare-minimal test case:
----range.d----
@property front()() { }
---------------
----test.d----
struct S
{
import range;
}
unittest
{
S a1;
foreach(i, e; a1)
{
}
}
---------------
Compiler command: dmd -main -unittest test.d