https://issues.dlang.org/show_bug.cgi?id=24211
--- Comment #2 from Basile-z <[email protected]> --- A bit more of analysis: function attributes apply to the context. The fact that this works is more related to another problem that is "function signatures are wrong" ```d struct S { function f() const {} } ``` is actually more like ```d struct S {} function f(const S* s){} ``` The storage class cannot be put on a parameter that dont exist, so the D solution is to make the hidden `this` const using trailing attributes. That should apply to nested function too, those that captures `this`. --
