[phobos] [D-Programming-Language/phobos] 601c75: Improve parsing error handling

Jonathan M Davis jmdavisProg at gmx.com
Sun Sep 4 23:41:11 PDT 2011


On Sunday, September 04, 2011 23:34:58 Walter Bright wrote:
> On 9/4/2011 10:54 PM, Jonathan M Davis wrote:
> > It's a bug in dmd. string literals aren't lvalues
> 
> Yes, they are, because one can take the address of them.
> 
> What they are not are *modifiable* lvalues.

It still baffles me why anything other than a variable would be an lvalue or why 
you would ever be able to take the address of anything other than a variable 
or a function. But what is is, I guess.

In any case, if that's what's going on, string literals really should be typed 
as immutable strings and not be accepted by a function which takes ref string.

- Jonathan M Davis


More information about the phobos mailing list