This is D2 code: Foo!(TArray) foo(TArray)(TArray r) { // the usual helper function return Foo!(TArray)(r); } struct Foo(TArray) { TArray arr; bool empty() { return !arr.length; } void popFront() { arr = arr[1 .. $]; } // int front() { return arr[0]; } // OK auto front() { return arr[0]; } // line 12 } void main() { foreach (el; foo([10])) {} } DMD 2.043 prints: test.d(12): Error: forward reference to inferred return type of function call __r1.front()
This bug is missing in dmd 2.048, so I close it.