Bug 12634 – [D1] Wrong code with string literal concatenation

Status
RESOLVED
Resolution
WORKSFORME
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86_64
OS
Linux
Creation time
2014-04-24T13:56:55Z
Last change time
2019-11-07T08:04:41Z
Assigned to
No Owner
Creator
Dicebot

Comments

Comment #0 by public — 2014-04-24T13:56:55Z
With latest DMD1: ```D const the_victim = "ok"; const the_killer = the_victim ~ "Thatcher"; void main() { assert(the_victim == "ok"); } ```
Comment #1 by andrej.mitrovich — 2014-12-12T16:33:57Z
Update w.r.t. a reproducible test-case: ----- class C { // uncomment char[] to fix bug private static const /*char[]*/ PATH = "asdf"; private static const PATH2 = PATH ~ "/bcde"; } void main() { assert(C.PATH == "asdf"); } -----
Comment #2 by public — 2014-12-12T18:10:19Z
May be related to the fact that string literals are deduced as static arrays in D1
Comment #3 by razvan.nitu1305 — 2019-11-07T08:04:41Z
This issue does not manifest in D2 git master and D1 is no longer supported. Closing as WORKSFORME.