https://d.puremagic.com/issues/show_bug.cgi?id=12408
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #2 from [email protected] 2014-03-19 16:06:56 PDT --- Seems invalid to me. Take a look at this reduced example: //---- struct L(T) { T t; } auto l(T)(T t) { return L!T(); } class S { auto foo() inout { return l(a); } int a; } void main() { } //---- What's basically happening in "foo", is you are creating a type `L!(inout(int))`, which has a member t with qualifier `inout(int)`. That don't make no sense. You need to chose the static type you are returning. The type *itself* may be marked as inout. However, that's not what you are doing: You are returning a type that's parameterized on inout, which is not the same at all. The idea of "inout" (as I have understood it), is that there is a *single* implementation that is compatible for all of const/immutable/mutable. That's not quite what you are doing. I think you simply need a const/non-const overload. Then, they'll return 2 actual different types "map!(L[])" and "map!(const(L)[])" (and you can even add an immutable overload if you so wish). -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
