Enhancement: Disallow concatenating string expressions in initializer/argument list
const IGNORED_FILES[*] = {
"test/test_suite/arrays/inferred_array_err.c3",
"test/test_suite/cast/cast_parse_fails.c3",
"test/test_suite/cast/cast_parse_fails2.c3",
"test/test_suite/compile_time/ct_switch_more_checks.c3",
"test/test_suite/contracts/in_array.c3"
"test/test_suite/define/common2.c3",
"test/test_suite/define/define_name_errors.c3",
};
Did you spot the missing comma? I think it's very easy to miss the missing comma and get confused.
I propose string concatenation should be required to be in parenthesis inside an initializer list or part of a function/macro argument list.
This might be desirable, but it's also surprising and very much special casing things.
I can't see how this could be fixed without special casing in a hard to describe way. Outside of eliminating C style const string concat.
Would emitting a warning also be special casing things?
I imagine a separate linter tool could also warn about this then.
eliminating C style const string concat.
Personally I would be in favour of that, as it's more explicit to use a multi-line string to signal the programmer's intent if that's desired behavior
@joshring raw strings also completely ignores escapes etc. So they're not the same thing. It's not a replacement. C string concat allows this:
String foo =
"okeofkoekfe"
"foekfeokfok"
"ofekofkeokf";
Which might be exactly what's desired. So I'm not really interested in killing off that feature, since I use it daily.