Here's something that I ran into while writing dfix`s implicit string concatenation cleanup code:

```
// accepted
deprecated("This function is dumb and you shouldn't use it)
void deleteT3hH4rdDisk();

// accepted
deprecated("This function is dumb and" " you shouldn't use it)
void deleteT3hH4rdDisk();

// parse error
deprecated("This function is dumb and" ~ " you shouldn't use it)
void deleteT3hH4rdDisk();
```

According to this[1] the behavior is correct, however it is not intuitive that a programmer cannot split up the string for "deprecated" over multiple lines without depending on D's bug-prone behavior of implicitly joining adjacent string literals.

There are two solutions to this that I see, one is to allow a combination of string literals and "~" operators, and the other is to allow arbitrary expressions that evaluate to a string.

Right now I favor allowing string literals and "~" because it's a smaller change. I can write up a DIP for this if there's a decent chance of this getting approved.

[1] http://dlang.org/grammar.html#DeprecatedAttribute

Reply via email to