https://issues.dlang.org/show_bug.cgi?id=15651
Simen Kjaeraas <simen.kja...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |simen.kja...@gmail.com Component|dmd |phobos --- Comment #1 from Simen Kjaeraas <simen.kja...@gmail.com> --- This issue is only partially fixable - filter() could use the solution described in issue 13428 to turn inout(T) into const(T). This would lead to fun() returning a const(D)[] result instead of inout(D)[], so it's not a complete solution. A complete solution, in fact, is not actually possible - consider the case of returning SomeStruct!(inout(D)). inout(D) is only a valid type inside the inout function - after returning, inout(D) should turn into D, const(D), or immutable(D). That means SomeStruct!(inout(D)) should turn into SomeStruct!(const(D)) or one of the other constancy variations, and this type might be completely different from SomeStruct!(inout(D)), due to the way D's templates work. Perhaps a solution could be found to this problem, but it would very likely require a DIP. --