https://issues.dlang.org/show_bug.cgi?id=19441
--- Comment #16 from [email protected] --- The code of my testcase should now be (with explicit opAssign): ``` EntryType arr; auto getPtr() { return &arr; } struct EntryType { int somethingelse; bool _state; void opAssign(typeof(_state) rhs) { _state = rhs; } alias _state this; } struct S1 { @property auto ref entry() { return *getPtr(); } void opAssign(bool rhs) { entry() = rhs; } alias entry this; } void main(){ S1 s1; s1 = true; } ``` Learnings: - write to `alias this` only allowed when fully overwriting the struct _itself_ - write to only part of struct: use opAssign - write to other data than struct itself: use opAssign --
