Unique syntax errors in OCEs with member initializers in --keep-going mode
struct Rectangle {
int x;
int y;
}
class StringHolder {
public string str { get; set; }
}
void main() {
// the use of a cast causes a syntax error inside a member initializer
// expression in `--keep-going` mode
var rect = Rectangle() { x = (int)3, /* no problems here */ y = 4 };
// same thing for string literals
var sh = new StringHolder() { str = "hello" };
}
valac --keep-going oce-with-member-inits.vala
oce-keep-going.vala:13.34-13.34: error: syntax error, expected identifier
var rect = Rectangle() { x = (int)3, /* no problems here */ y = 4 };
^
oce-keep-going.vala:15.41-15.47: error: syntax error, expected identifier
var sh = new StringHolder() { str = "hello" };
^^^^^^^
Compilation failed: 2 error(s), 0 warning(s)
These errors do not appear when --keep-going
is removed.