[Issue 3827] automatic joining of adjacent strings is bad

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 16 17:11:00 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3827


Stewart Gordon <smjg at iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg at iname.com


--- Comment #17 from Stewart Gordon <smjg at iname.com> 2010-11-16 17:09:41 PST ---
(In reply to comment #5)
> The error message for the missing ~ can be something like this (adapted from
> the "'l' suffix is deprecated, use 'L' instead" error message generated by the
> usage of a 10l long literal):
> 
> adjacent string literals concatenation is deprecated, add ~ between them
> instead.

Better watch out for cases where just adding ~ changes the behaviour.

For example, if a is a string[], then a ~ "this" "that" and a ~ "this" ~ "that"
evaluate to different strings.

Not that there's any real use case for "this" "that" anyway.  And those rare
use cases it does have in D can be fixed by inserting the ~, though there may
be easier-to-miss cases of the above of which to be wary.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list