https://issues.dlang.org/show_bug.cgi?id=3827

--- Comment #33 from [email protected] ---
A problem with @nogc:


void main() @nogc {
    string s1 = "AB" "CD";   // OK
    string s2 = "AB" ~ "CD"; // Error
}


temp.d(3,17): Error: cannot use operator ~ in @nogc function main


Some workarounds:

void main() @nogc {
    static immutable string s3 = "AB" ~ "CD"; // OK
    string s4 = ctEval!("AB" ~ "CD");         // OK
}


Where ctEval is used to generate a compile-time value.

--

Reply via email to