On Friday, 7 February 2020 at 22:55:29 UTC, Dennis wrote:
Oops, minimized a bit too much. Corrected test case:
```
import std;
struct S {
@safe:
int[3] front = [10, 20, 30];
bool empty = false;
void popFront() {empty = true;}
}
void main() @safe {
S.init.map!((return ref x) => x[]).joiner.writeln;
}
```
It indeed still errors with -dip1000, but without -dip1000 it
compiles now interestingly.
```
import std;
struct SomeRange
{
int[3] val;
enum empty = false;
auto popFront() @safe {}
ref auto front() @safe
{
return val;
}
}
void main() @safe
{
SomeRange().take(10).map!((return ref x) =>
x[]).joiner.writeln;
}
```
I don't know how applicable this is to your use case, but this
code will compile and run under -dip1000.