[Issue 18594] X is not an lvalue should have a better error message

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 22 18:14:48 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=18594

duser at neet.fi changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |duser at neet.fi

--- Comment #6 from duser at neet.fi ---
the same error message is given when taking the address of a non-lvalue, but
"cannot be modified" doesn't necessarily apply there (and can be confusing)

// Error: `a[0..2]` is not an lvalue and cannot be modified
ubyte[2] a;
const void* p1 = &a[0..2];

// Error: cannot modify constant `1`
const void* p2 = &1;

for these, the message should rather say something like "cannot have its
address taken"

--


More information about the Digitalmars-d-bugs mailing list