Bug 24678 – mixin does not work with interpolated strings

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-07-24T12:04:07Z
Last change time
2024-12-13T19:36:41Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
Bolpat
Moved to GitHub: dmd#20492 →

Comments

Comment #0 by qs.il.paperinik — 2024-07-24T12:04:07Z
The following should work: ```d const name = "x"; mixin(iq{int $(name) = 10;}); ``` But it fails because `mixin` has no understanding of interpolated strings and requires (among other alternatives) appending `.text` to every `i` string literal, which requires a needless `import` and thus a dependency. String mixin and interpolated strings are core-language features and those should work together.
Comment #1 by robert.schadek — 2024-12-13T19:36:41Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20492 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB