Thread overview
[Issue 8006] Implement proper in-place-modification for properties
Oct 09, 2016
mikey
Aug 07, 2017
Mike
Aug 11, 2017
Mike
Aug 14, 2017
Walter Bright
Aug 14, 2017
Mike
Dec 17, 2022
Iain Buclaw
June 20, 2016
https://issues.dlang.org/show_bug.cgi?id=8006

greensunny12@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |16187

--
June 20, 2016
https://issues.dlang.org/show_bug.cgi?id=8006

greensunny12@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greensunny12@gmail.com

--- Comment #4 from greensunny12@gmail.com ---
Issue 16187 (bitmanip fields should be lvalues) depends on this. Has anyone worked on implementing this lowering on the DMD frontend?

--
October 09, 2016
https://issues.dlang.org/show_bug.cgi?id=8006

mikey <abc.mikey@googlemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |abc.mikey@googlemail.com

--- Comment #5 from mikey <abc.mikey@googlemail.com> ---
As a beginner this is a source of some confusion for me. Ideally the implementation details of a property vs a member variable should be transparent to me as a user of a given object.




class Test {
private:
    int _val, _val2;

public:

    @property int val() { return _val; }
    @property void val(int val) { _val = val; }

    @property auto ref val2() { return _val2; }
}

void main() {

    auto t = new Test;
    //t.val += 100; // BAD - not an lvalue

    t.val(t.val + 100); // probably preferable to misleading syntax

    t.val2 += 200; // OK - but inconsistent

    import std.stdio : writefln;
    writefln("val: %d, val2: %d", t.val, t.val2);
}

~

--
August 07, 2017
https://issues.dlang.org/show_bug.cgi?id=8006

Mike <slavo5150@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |slavo5150@yahoo.com

--
August 11, 2017
https://issues.dlang.org/show_bug.cgi?id=8006

--- Comment #6 from Mike <slavo5150@yahoo.com> ---
An attempt at a partial implementation: https://github.com/dlang/dmd/pull/7079/files

--
August 14, 2017
https://issues.dlang.org/show_bug.cgi?id=8006

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=16187

--
August 14, 2017
https://issues.dlang.org/show_bug.cgi?id=8006

Mike <slavo5150@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=15231

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=8006

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P4

--