Thread overview
[Issue 14102] Bad 'is not an lvalue' diagnostic in chained -unary and --preincr expressions.
Feb 01, 2015
Iain Buclaw
Feb 01, 2015
Iain Buclaw
Feb 16, 2015
Kenji Hara
Dec 16, 2022
RazvanN
February 01, 2015
https://issues.dlang.org/show_bug.cgi?id=14102

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw@gdcproject.org

--- Comment #1 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Of course, this is a pathological case, but artificial names should never be exposed in compiler errors.

--
February 01, 2015
https://issues.dlang.org/show_bug.cgi?id=14102

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic

--
February 16, 2015
https://issues.dlang.org/show_bug.cgi?id=14102

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86_64                      |All
                 OS|Linux                       |All

--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> ---
PR https://github.com/D-Programming-Language/dmd/pull/4415 will improve the diagnostic to:

test.d(3): Error: -x is not an lvalue
test.d(4): Error: -(x -= 1) is not an lvalue
test.d(5): Error: -(x -= 1 -= 1) is not an lvalue
test.d(6): Error: -(x -= 1 -= 1 -= 1) is not an lvalue

It's not perfect, but far better.

--
February 18, 2015
https://issues.dlang.org/show_bug.cgi?id=14102

--- Comment #3 from github-bugzilla@puremagic.com ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/bf3cb7bf5d3f735cebe07757e4d03c88b76d00d4 A little diagnostic improvement for issue 14102

--
February 21, 2015
https://issues.dlang.org/show_bug.cgi?id=14102

--- Comment #4 from github-bugzilla@puremagic.com ---
Commit pushed to https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/bf3cb7bf5d3f735cebe07757e4d03c88b76d00d4 A little diagnostic improvement for issue 14102

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

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305@gmail.com
         Resolution|---                         |WORKSFORME

--- Comment #5 from RazvanN <razvan.nitu1305@gmail.com> ---
I now get:

test.d(3): Error: `-x` is not an lvalue and cannot be modified
test.d(4): Error: `-(x -= 1)` is not an lvalue and cannot be modified
test.d(5): Error: `-(x -= 1 -= 1)` is not an lvalue and cannot be modified
test.d(6): Error: `-(x -= 1 -= 1 -= 1)` is not an lvalue and cannot be modified

Looks fine to me. Closing as WORKSFORME. @Iain, is this what you were expecting?

--