https://issues.dlang.org/show_bug.cgi?id=18594
Tobias Pankrath <tob...@pankrath.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tob...@pankrath.net --- Comment #5 from Tobias Pankrath <tob...@pankrath.net> --- --- struct Test(T) { @property ref T get() inout { return member; } private: T member; } int main(string[] args) { Test!int t; t.get = 12; return t.get; } --- This code has an very similar issue: > test.d(3): Error: cast(int)this.member is not an lvalue and cannot be modified The correct definition is: --- struct Test(T) { @property ref inout(T) get() inout { return member; } private: T member; } --- but the error message gives no hint in that direction. It confused me quite a bit, since IMO member is a fine lvalue that happens to be const/inout. https://run.dlang.io/is/IJKZ80 --