https://issues.dlang.org/show_bug.cgi?id=20149
--- Comment #25 from Walter Bright <[email protected]> --- A further simplified test case: @safe: struct S { //inout(char)* slice() inout return /* gives correct error */ inout(char)* slice() inout /* no error */ { return &buf; } char buf; } char* fun() { S sb; return sb.slice(); } Note that if slice() were made as a static function, with sb passed by ref as the first parameter, the compilation gives the correct error. Hence it's related to the `this` being a special case. --
