Sample:
struct X(Data)
{
Data d;
inout(Data)* foo(this This)() inout // line 4
{
return &d;
}
}
void main()
{
immutable x = X!double(5.9);
auto r = x.foo();
}
Result:
inouttest.d(4): Error: inout on return means inout must be on a parameter as well for immutable inout(double)*()
Clearly, inout is not applying to the function when it should. Removing "(this This)" fixes the problem
Comment #1 by robert.schadek — 2024-12-13T18:20:54Z