Bug 21866 – Templates confuse error message to use wrong string litteral

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2021-04-26T18:44:26Z
Last change time
2024-12-13T19:15:58Z
Assigned to
No Owner
Creator
crazymonkyyy
Moved to GitHub: dmd#19912 →

Comments

Comment #0 by crazymonkyyy — 2021-04-26T18:44:26Z
template setup(string s){ void dosomething(){ mixin(s); } } void main(){ int s; mixin setup!"s=1;"; dosomething; s.writeln; } >mix(2): Error: cannot modify string literal `"s=1;"` Should read "cant modify string literal "s"", "s=1" is not being modified and with the original code was completely unrelated
Comment #1 by robert.schadek — 2024-12-13T19:15:58Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19912 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB