This could should error stating that `a~b` is not allowed in betterC string foo()() { string a, b; return a ~ b; } extern(C) void main() { foo(); } However, it gives a linker error because the compiler chooses to simply not emit the functions that use the GC when using the -betterC switch.
@royalpinto007 created dlang/dmd pull request #17492 "fix Bugzilla 23803 - compile-time error for concatenation in -betterC" fixing this issue: - fix Bugzilla 23803 - compile-time error for concatenation in -betterC Signed-off-by: royalpinto007 <royalpinto007@gmail.com> https://github.com/dlang/dmd/pull/17492