https://issues.dlang.org/show_bug.cgi?id=17661
--- Comment #2 from [email protected] --- Haha, I tried doing that but ran into another bug: ------ struct C { private S* impl; } struct S { bool empty; @property C front() return { return C(&this); } void popFront() { } pragma(msg, typeof((S r) return => r.front)); } ------ Compiler output (dmd -dip25 -dip1000): ------ test.d(10): Error: returning r.front() escapes a reference to parameter r, perhaps annotate with return _error_ ------ Because of this, isInputRange still doesn't work, with your proposed change. Apparently dmd fails to pick up the `return` annotation for some reason. Which is actually rather strange, because: ------- pragma(msg, typeof((int* r) return => r)); ------- prints: ------- int* function(return int* r) pure nothrow @nogc return @safe ------- so obviously the syntax is correct, and at least some of the time dmd is able to process it correctly. I've no idea why it doesn't pick up the annotation and/or process it correctly when in the first code snippet above. --
