https://issues.dlang.org/show_bug.cgi?id=21866
Issue ID: 21866
Summary: Templates confuse error message to use wrong string
litteral
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
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
--