I tried the following to no avail:
class Test { inout(Test) f() inout { return this; } } Result:test.d(3): Error: inout on return means inout must be on a parameter as well for inout inout(Test)()
It seems to me that the compiler could check the method's constness along with that of its parameters, but doesn't (omission / unimplemented feature?)
-- Best regards, Vladimir mailto:vladi...@thecybershadow.net