[Issue 16014] Concatenated strings don't work in deprecation messages on module statements

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed May 11 07:41:19 PDT 2016


--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> ---
Although the OP code is legitimate from the D grammar spec, there's not yet
proper definition/implementation for the semantic analysis.

I'm not sure how compiler should behave with:

deprecated(a.foo() ~ a.bar()) module a;

string foo() { /* some CTFEable code 1 */ }
string bar() { /* some CTFEable code 2 */ }


Note that if we replace module with struct:

deprecated(S.foo) struct S   // line 1
    static foo() { return "hello"; }
alias P = S*;  // line 5

Current compiler prints:

test.d(1): Deprecation: struct test.S is deprecated
test.d(5): Deprecation: struct test.S is deprecated - hello

The use of S in custom message expression exposes incompletion of semantic
analysis process. It's bad behavior.


More information about the Digitalmars-d-bugs mailing list