[Issue 1472] Be more clever about detecting assigment to non-l-values

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 22 09:15:24 UTC 2019


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305 at gmail.com
         Resolution|---                         |WONTFIX

--- Comment #4 from RazvanN <razvan.nitu1305 at gmail.com> ---
The spec clearly states that "a variable or the result of the DotIdentifier
grammatical construct . (left side may be missing) when the rightmost side of
the dot is a variable, field (direct or static), function name, or invocation
of a function that returns by reference" is an lvalue.

Therefore:

x.get_struct.i = 10;

is fine and:

x.get_struct.set_i(10);

is also fine, because you are calling the function of a temporary.

Closing as WONTFIX.

--


More information about the Digitalmars-d-bugs mailing list